<?PHP
if (ereg("www\.test", $_SERVER['HTTP_REFERER']) != true)
{
header("location http://www.example.com");
end;
}
echo "111";
//dosomting?
?>
它仍无法正常工作
答案 0 :(得分:3)
试试这个:
<?php
if (!preg_match("www\.test", $_SERVER['HTTP_REFERER'])) {
header("Location: http://www.example.com");
exit();
}
//do stuff...
?>