Get original URL referer with PHP?
Store it either in a cookie (if it’s acceptable for your situation), or in a session variable. session_start(); if ( !isset( $_SESSION[“origURL”] ) ) $_SESSION[“origURL”] = $_SERVER[“HTTP_REFERER”];
Store it either in a cookie (if it’s acceptable for your situation), or in a session variable. session_start(); if ( !isset( $_SESSION[“origURL”] ) ) $_SESSION[“origURL”] = $_SERVER[“HTTP_REFERER”];
You could use the UrlReferrer property of the current request: Request.UrlReferrer This will read the Referer HTTP header from the request which may or may not be supplied by the client (user agent).
It will/may be empty when the enduser entered the site URL in browser address bar itself. visited the site by a browser-maintained bookmark. visited the site as first page in the window/tab. clicked a link in an external application. switched from a https URL to a http URL. switched from a https URL to a … Read more