Snippet. PHP. Get the Referrer to the Current WebpageYou can find the referer to the current webpage by using the $_SERVER["HTTP_REFERER"] variable. This is possible because when you browse the pages, the browser passes the URL it came from. Note: The HTTP_REFERER can not be fully trusted. Many browsers provide the ability to modify the referrer variable. Additionally, if a user is behind a firewall, the referrer variable can be empty or changed. <?php $referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false; ?> Updated on: 21 Dec 2024 |
|