复制代码 代码如下:
function get_referer(){
$se = 0;
$url = $_SERVER["HTTP_REFERER"]; //获取完整的来路URL
$str = str_replace("http://","",$url); //去掉http://
$strdomain = explode("/",$str); // 以“/”分开成数组
$domain = $strdomain[0]; //取第一个“/”以前的字符
if(strstr($domain,'baidu.com')){
$se = 1;
}
else if(strstr($domain,'google.cn')){
$se = 1;
}
return $se;
}
http://www.bkjia.com/PHPjc/321978.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/321978.htmlTechArticle复制代码 代码如下: function get_referer(){ $se = 0; $url = $_SERVER["HTTP_REFERER"]; //获取完整的来路URL $str = str_replace("http://","",$url); //去掉http:// $strd...