PHP cross-domain get previous page URL problem

Source: Internet
Author: User
For example, from www.baidu.com click the current page to jump to www.163.com $_server[' http_referer '] this variable once cross-domain, it becomes the current page, I want to get the previous page URL, how to break?

Reply content:

For example, from www.baidu.com click the current page to jump to www.163.com $_server[' http_referer '] this variable once cross-domain, it becomes the current page, I want to get the previous page URL, how to break?

$_server[' Http_referer ' will fail if you jump from the SSL certification website link to your current page.
But non-SSL between different domain names jump $_server[' http_referer '] fetch the URL of the previous page should be no problem.

$_server[' Http_referer '] several possible reasons for not taking a value

    • Hit the URL directly within the browser
    • Hyperlink icon on the Windows desktop
    • In-browser bookmarks
    • Links in content such as Word,excel
    • Links within the mail management software such as Outlook
    • SSL authentication website jumps in
    • Meta page settings automatically jump when example.com will not get Referer URL

Welcome to Add.

On the www.163.com page Print_r ($_server) See if there's anything you want.

$_server[' Http_referer ' #链接到当前页面的前一页面的 URL address

  • Related Article

    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: info-contact@alibabacloud.com 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.