mbabli Posted August 21, 2006 Share Posted August 21, 2006 Hello everyone, If I redirect HTML page using the <META EQUIV-HTTP="Refresh"...etc> What are my options of retreiving the source URL before the redirection. Any help would be appreciated. PS: $_SERVER['REFERRER'; Is an empty string after redirecting. Link to comment https://forums.phpfreaks.com/topic/18226-php-and-redirect/ Share on other sites More sharing options...
pachelbel101 Posted August 21, 2006 Share Posted August 21, 2006 Before the redirection you can use $_SERVER['PHP_SELF'] OR $_SERVER['REQUEST_URI'] to get the source URL.Then you can carry it over to the next script by attaching it to the redirect url as a GET ("?src=$_SERVER[REQUEST_URI]") or store it in $_SESSION. Link to comment https://forums.phpfreaks.com/topic/18226-php-and-redirect/#findComment-78242 Share on other sites More sharing options...
ober Posted August 21, 2006 Share Posted August 21, 2006 I think you want $_SERVER['HTTP_REFERER']. Link to comment https://forums.phpfreaks.com/topic/18226-php-and-redirect/#findComment-78245 Share on other sites More sharing options...
mbabli Posted August 21, 2006 Author Share Posted August 21, 2006 Thanks for the fast reply (Both): For solution 1: Unfortunately, the source page is HTML (Static), however, what I need is the source url (the info I need is in it). and altering Apache to hanle html as php is not the most feasible at the moment. For Solution 2: HTTP_REFERRER is an empty string if redirected because the referrer would be the browser itself. Any more suggestions? Thanks in advance Link to comment https://forums.phpfreaks.com/topic/18226-php-and-redirect/#findComment-78247 Share on other sites More sharing options...
theblain Posted August 21, 2006 Share Posted August 21, 2006 You can't use $_SERVER['HTTP_REFERRER'] BEFORE you redirect, and then pass the variable to the redirected page? Link to comment https://forums.phpfreaks.com/topic/18226-php-and-redirect/#findComment-78294 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.