PHP site source code (for search engines)
- 2020-03-31 20:54:30
- OfStack
function get_referer(){
$se = 0;
$url = $_SERVER["HTTP_REFERER"]; //Gets the full source URL
$str = str_replace("http://","",$url); //Remove the HTTP: __
$strdomain = explode("/",$str); //Split into an array with /
$domain = $strdomain[0]; //Take the character before the first "/"
if(strstr($domain,'baidu.com')){
$se = 1;
}
else if(strstr($domain,'google.cn')){
$se = 1;
}
return $se;
}