This repository has been archived on 2024-02-16. You can view files and clone it, but cannot push or open issues or pull requests.
ITSynOpen/server/ping-get.php

23 lines
417 B
PHP
Raw Normal View History

2016-03-20 19:53:26 +01:00
<?php
2022-03-27 18:19:55 +02:00
require_once('config.inc.php');
2022-03-27 18:19:55 +02:00
$apikeys = $config['ping-get'];
2016-03-20 19:53:26 +01:00
2022-03-27 18:19:55 +02:00
header('Content-type: text/plain');
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
echo "Must use POST request method\n";
return;
2022-03-27 18:19:55 +02:00
}
if (!isset($_GET['apikey']) || !in_array($_GET['apikey'], $apikeys, true)) {
echo "Invalid API key\n";
return;
}
$str=file_get_contents('pinged.txt');
echo $str;
file_put_contents('pinged.txt', 'false');
2022-03-27 18:19:55 +02:00
?>