$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : NULL;
$host = $_SERVER['HTTP_HOST'];
echo '提交过来的地址:'.$referer;
echo '<br>';
echo '本站域名:'.$host;
echo '<br>';
echo substr($referer,7,strlen($host));
if(substr($referer,7,strlen($host)) != $host){
echo '非法操作';
}else{
echo '正常操作';
}
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn