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

21 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');
?>