Php website to obtain code (for search engines ). Copy the code as follows: functionget_referer () {$ se0; $ url $ _ SERVER [HTTP_REFERER]; get the complete URL $ strstrstr_replace (, $ url); remove $ strd
The code is as follows:
Function get_referer (){
$ Se = 0;
$ Url = $ _ SERVER ["HTTP_REFERER"]; // obtain the complete URL
$ Str = str_replace ("http: //", "", $ url); // remove http ://
$ Strdomain = explode ("/", $ str); // split it into an array "/"
$ Domain = $ strdomain [0]; // take the first character before "/"
If (strstr ($ domain, 'Baidu. com ')){
$ Se = 1;
}
Else if (strstr ($ domain, 'google. cn ')){
$ Se = 1;
}
Return $ se;
}
The http://www.bkjia.com/PHPjc/321978.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/321978.htmlTechArticle code is as follows: function get_referer () {$ se = 0; $ url = $ _ SERVER ["HTTP_REFERER"]; // obtain the complete URL $ str = str_replace ("http: //", "", $ url); // remove http: // $ strd...