$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : NULL;
$host = $_SERVER['HTTP_HOST'];
/*echo '提交过来的地址:'.$referer;
echo '
';
echo '本站域名:'.$host;
echo '
';
echo substr($referer,7,strlen($host));
*/
if(substr($referer,7,strlen($host)) != $host){
echo '非法操作';
exit;
}else{
// echo '正常操作';
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询