i have a subdomain if some one open it will post some data using php curl.
i have done header protection and auth with rest api.
now how can i protect the subdomain to auto hit or false or boot protection.here is the url to check https:
i want a user can access this url every 30 min after, after 1 time access this url.
What I have tried:
session_start();
$dns = $_SERVER['SERVER_NAME'];
$host = explode('.', $dns);
$subdomain = $host[0];
$domain = $host[1].'.'.$host[2];
$serverdetails = $_SERVER['HTTP_USER_AGENT'];
$ip=$_SERVER['REMOTE_ADDR'];
$token= session_id();;
$poston= date("Y-m-d H:i:s");
$sUrl="myurl";
$data=array('domain' => $domain,'subdomain' => $subdomain,'serverdetails' => $serverdetails,'ip' => $ip,'token' => $token,'poston' => $poston);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $sUrl,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 1,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS=> $data,
CURLOPT_HTTPHEADER => array(
'header-token: mytoken',
'Authorization: Basic myoth',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;