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.php

18 lines
411 B
PHP
Raw Normal View History

2016-03-20 19:53:26 +01:00
<?php
2022-03-27 18:19:58 +02:00
require_once('config.inc.php');
$apikeys = $config['ping'];
2016-03-20 19:53:26 +01:00
2022-03-27 18:19:58 +02:00
header('Content-type: text/plain');
if ($_SERVER['REQUEST_METHOD'] == 'POST' &&
isset($_GET['apikey']) && in_array($_GET['apikey'], $apikeys, true))
{
file_put_contents ( 'pinged.txt' , 'true' );
echo $str;
} else {
$str=file_get_contents('pinged.txt');
echo "API Key Missing (must be POST method)!\n";
echo $str;
}
?>