Php retrieves analysis functions from the [previous Page] page. Php retrieval method [Previous Page] page analysis function this article provides a function to fully obtain functions on the previous page. Functiongetref ($ ref, $ fullref) {globa php gets the analysis function from the [previous Page] page.
This article provides a comprehensive function to obtain functions on the upper-level page.
Function getref (& $ ref, & $ fullref ){
Global $ err, $ conf, $ HTTP_GET_VARS, $ _ GET;
If (isset ($ _ GET ['anr']) $ refer = $ _ GET ['anr'];
Elseif (isset ($ HTTP_GET_VARS ['anr']) $ refer = $ HTTP_GET_VARS ['anr'];
Else $ refer = 'undefined ';
If (empty ($ refer) $ refer = 'undefined ';
If (! Strcmp ($ refer, 'null') $ refer = 'undefined ';
$ Refer = urldecode ($ refer );
$ Refer = modsec ($ refer );
$ Refer = txtproc ($ refer );
// To correct back slash http://111cn.cnindex
$ Refer = str_replace ("", "/", $ refer );
// To remove unnecessary points http://111cn.cn.
$ Refer = preg_replace ("//./", '/', $ refer );
$ Refer = preg_replace ("/. //", '/', $ refer );
$ Refer = preg_replace ("/. * $/", '', $ refer );
$ Refer = preg_replace ("/(" | ') * $/",'', $ refer );
// To remove unnecessary duplicates of slashes http://111cn.cn ///
$ Refer = preg_replace ("/([^:]) (/) +/", '$1/', $ refer );
$ Fullref = $ refer;
$ Refer = preg_replace ("/^ (https? : //) (Www .)? /I ",'', $ refer );
$ Ref = preg_replace ("/[? | & | # |;]. * $/I ",'', $ refer );
$ Ref = preg_replace ("/(/) * $/", '', $ ref );
$ Ref = trim ($ ref );
$ Ref = preg_replace ("/. * $/", '', $ ref );
$ Ref = preg_replace ("/(" | ') * $/",'', $ ref );
$ Ref = trim ($ ref );
// Check referrer (bad)
If (empty ($ ref) $ ref = 'undefined ';
// Search "." in domain name
If (! Preg_match ("/^ ([^./] +.) + ([^./]) +/I", $ ref) $ ref = 'undefined ';
}
}
Http://www.bkjia.com/PHPjc/445039.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445039.htmlTechArticlephp to obtain the road [Previous Page] page analysis function this article provides a comprehensive function to obtain the function of the upper-level page Oh, is the road function. Function getref ($ ref, $ fullref) {globa...