$url = $_GET['url'];
if (isset($_SERVER['HTTP_REFERER'],$url)){
if (stripos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) === false){
echo json_encode(['code'=>500,"msg"=>"禁止盗用API"],JSON_UNESCAPED_UNICODE);
exit;
}
}else{
echo json_encode(['code'=>500,"msg"=>"禁止直接访问"],JSON_UNESCAPED_UNICODE);
exit;
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询