Jump to content

Archived

This topic is now archived and is closed to further replies.

pcwood

Where did I come from?

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
$_SERVER['HTTP_REFERER'] will return the referrer but it can be tricked fairly easy... Then again so can JS...

Share this post


Link to post
Share on other sites
Good answer.  Thank You.  Ultimatly, I did this:

[color=blue][/color]
$referrer = getenv("HTTP_REFERER");
if ($referrer == "") { $referrer="http://www.mywackysite.com/"; }

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.