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 Quote Link to comment Share on other sites More sharing options...
fert Posted October 20, 2006 Share Posted October 20, 2006 you could use sessions or cookies Quote Link to comment 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 Quote Link to comment 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... Quote Link to comment 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/"; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.