pcwood Posted October 20, 2006 Share Posted October 20, 2006 Greetings,Is it possible to know, in a php based webpage, how to determine the page from which the user was sent?I want to have a "SIGN IN" link on any page within a site but regardless of where the user signed in, once they have (successfully), I'd like to send them back to the originating page (no layers involved) from where they came (or decided to click on the sign-in link).TIA---Paul Wood Link to comment https://forums.phpfreaks.com/topic/24608-where-did-i-come-from/ Share on other sites More sharing options...
fert Posted October 20, 2006 Share Posted October 20, 2006 you could use sessions or cookies Link to comment https://forums.phpfreaks.com/topic/24608-where-did-i-come-from/#findComment-112115 Share on other sites More sharing options...
pcwood Posted October 21, 2006 Author Share Posted October 21, 2006 I've considered this but I'd have to have some such identity for EVERY (and there are a lot) web page within the site. It's not really a feasable solution. I was hoping there was a php function I was unaware of which could glean the URL of the page the user just came from. Doesnt the "BACK" function in javascript pull this from the browser? If so, perhaps PHP can?Thanks for the response.-PCWOOD Link to comment https://forums.phpfreaks.com/topic/24608-where-did-i-come-from/#findComment-112171 Share on other sites More sharing options...
corbin Posted October 21, 2006 Share Posted October 21, 2006 $_SERVER['HTTP_REFERER'] will return the referrer but it can be tricked fairly easy... Then again so can JS... Link to comment https://forums.phpfreaks.com/topic/24608-where-did-i-come-from/#findComment-112182 Share on other sites More sharing options...
pcwood Posted October 21, 2006 Author Share Posted October 21, 2006 Good answer. Thank You. Ultimatly, I did this:[color=blue][/color]$referrer = getenv("HTTP_REFERER"); if ($referrer == "") { $referrer="http://www.mywackysite.com/"; } Link to comment https://forums.phpfreaks.com/topic/24608-where-did-i-come-from/#findComment-112405 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.