PHP cannot obtain Referer troubleshooting. referer troubleshooting _ PHP Tutorial

Source: Internet
Author: User
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

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

Testing result :? Phpecho 'test Source: directly load the page br/'; echo 'a href = "test_cookie.php" to enter the page/abr/'; echo 'test source...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.