Jump to content


Photo

Where did I come from?


  • Please log in to reply
4 replies to this topic

#1 pcwood

pcwood
  • New Members
  • Pip
  • Newbie
  • 5 posts
  • LocationDelaware

Posted 20 October 2006 - 10:34 PM

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
---
Paul Wood

#2 fert

fert
  • Members
  • PipPipPip
  • Advanced Member
  • 1,114 posts

Posted 20 October 2006 - 11:09 PM

you could use sessions or cookies

Si hoc legere scis nimium eruditionis habes
Gentoo Linux 2007.0 Firefox 2

#3 pcwood

pcwood
  • New Members
  • Pip
  • Newbie
  • 5 posts
  • LocationDelaware

Posted 21 October 2006 - 02:54 AM

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
---
Paul Wood

#4 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 21 October 2006 - 04:46 AM

$_SERVER['HTTP_REFERER'] will return the referrer but it can be tricked fairly easy... Then again so can JS...
Why doesn't anyone ever say hi, hey, or whad up world?

#5 pcwood

pcwood
  • New Members
  • Pip
  • Newbie
  • 5 posts
  • LocationDelaware

Posted 21 October 2006 - 07:28 PM

Good answer.  Thank You.  Ultimatly, I did this:


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

---
Paul Wood




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users