开发者

How to redirect if not from $_SERVER['HTTP_REFERER']?

<?PHP
if (开发者_JAVA百科ereg("www\.test", $_SERVER['HTTP_REFERER']) != true)
{
    header("location http://www.example.com");
    end;
}
    echo "111";
        //dosomting?
?>

It still not working


Try this:

<?php

   if (!preg_match("www\.test", $_SERVER['HTTP_REFERER'])) {
      header("Location: http://www.example.com");
      exit();
   }
   //do stuff...

?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜