Click here to Skip to main content
15,921,622 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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://1bang1.onlinebzsolutions.com/

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;
Posted
Comments
sumoncse07 21-Sep-22 14:48pm    
wp_is_mobile
Expanse, a Palo Alto Networks company, searches across the global IPv4 space multiple times per day to identify customers' presences on the Internet. If you would like to be excluded from our scans, please send IP addresses/domains to: scaninfo@paloal

this is what i am getting most of time in my database

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900