0
<?PHP
if (ereg("www\.test", $_SERVER['HTTP_REFERER']) != true)
{
header("location http://www.example.com");
end;
}
echo "111";
//dosomting?
?>
它仍然没有工作
<?PHP
if (ereg("www\.test", $_SERVER['HTTP_REFERER']) != true)
{
header("location http://www.example.com");
end;
}
echo "111";
//dosomting?
?>
它仍然没有工作
试试这个:
<?php
if (!preg_match("www\.test", $_SERVER['HTTP_REFERER'])) {
header("Location: http://www.example.com");
exit();
}
//do stuff...
?>
它'exit'不'太end' – BoltClock 2010-11-16 04:29:56
@BoltClock。 – 2010-11-16 04:31:33
'ereg'已弃用。使用'preg_match'。 – netcoder 2010-11-16 04:39:50