PHP cannot obtain Referer for troubleshooting and referer for troubleshooting. PHP cannot obtain Referer troubleshooting. referer troubleshooting test results :? Phpecho Test Source: directly load the page br; echoahreftest_cookie.php enter the page abr; echo test source PHP cannot obtain Referer troubleshooting, referer troubleshooting
Test results:
'; Echo' to go to the page
'; Echo' Test Source: New window opens
'; Echo' to go to the page
';
The code for test_cookie.php is:
\ R \ n "; echo 'php gets Refer: '; $ refer = isset ($ _ SERVER ['http _ referer'])? $ _ SERVER ['http _ referer']: 'No refer found '; echo $ refer; echo"
\ R \ n "; echo 'JS get Refer: '; echo" script document. writeln (document. referrer); script "; echo"
\ R \ n ";
I am extremely curious about what causes the first retrieval and the second retrieval.
The environment is LNMPA, the official is http://lnmp.org/lnmpa.html
Use charles to capture packets on Mac
The headers of test1.php are the same for two requests.
The headers of the two request test_cookie.php are consistent.
The problem arises. Why does PHP fail to obtain a refer for two identical requests. Begging for solutions.
More exciting topics focus on five blog http://www.lingdonge.com
Testing result :? Phpecho 'test Source: directly load the page br/'; echo 'a href = "test_cookie.php" to enter the page/abr/'; echo 'test source...