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

23 lines
699 B
PHP
Raw Normal View History

<?php
header('Content-type: text/plain');
if(isset($_GET['apikey']) && ($_GET['apikey']=='apikey1' || $_GET['apikey']=='apikey2')){
if(isset($_GET['open']) && $_GET['open']=='true')
{
file_put_contents ( 'status.txt' , 'true,'.time() );
echo "true";
}else if(isset($_GET['open']) && $_GET['open'] =='false')
{
file_put_contents ( 'status.txt' , 'false,'.time() );
echo "false";
}
}else{
$str=file_get_contents('status.txt');
$arr=explode(',',$str);
$open=$arr[0];
$date=$arr[1]; //lastchange: upadate via file see explode/implode
echo "API Key Missing!\n";
echo $open;
}
?>