20 lines
363 B
PHP
Executable file
20 lines
363 B
PHP
Executable file
<?php
|
|
|
|
require_once('config.inc.php');
|
|
$apikeys = $config['ping'];
|
|
|
|
header('Content-type: text/plain');
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
|
echo "Must use POST request method\n";
|
|
return;
|
|
}
|
|
|
|
if (!isset($_GET['apikey']) || !in_array($_GET['apikey'], $apikeys, true)) {
|
|
echo "Invalid API key\n";
|
|
return;
|
|
}
|
|
|
|
file_put_contents('pinged.txt', 'true');
|
|
|
|
?>
|