: This article mainly introduces how to troubleshoot the problem that PHP cannot obtain Referer. if you are interested in the PHP Tutorial, refer to it. Test results:
The same page is opened twice. the Referer cannot be obtained twice for the first time. I'm curious about the reason.
The test1.php code is:
'; 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
The above describes how to troubleshoot the problem that PHP cannot obtain Referer, including related content, and hope to help those who are interested in PHP tutorials.