Page 1 of 1

how to determine what page the user came from

Posted: Mon Mar 13, 2006 8:34 am
by jasongr
Hello

I need to know what page the user came from.
Assume that the page the user came from is within my domain
I don't want to rely on the browser history object as it seems to not reliable
is there a construct in PHP that gives me that info?

regards
Jason

Posted: Mon Mar 13, 2006 8:47 am
by Chris Corbyn

Code: Select all

print_r($_SERVER);
Namely:

$_SERVER['HTTP_REFERER']

Don't rely on it though... it's not always set so you'll need to make sure its set first ;)

Posted: Mon Mar 13, 2006 8:49 am
by jasongr
thanks
Yes I am aware of this construct and its limitations
maybe I will use sessions