...

View Full Version : previously visited page



bunny1
03-24-2007, 04:33 PM
How would you get the previous page's url in php code
I want to have a link to the page the user just came from but it could have been a number of different pages.

Thanks

zactanaz
03-24-2007, 07:43 PM
Use the superglobal to know where they came from:


$_SERVER[HTTP_REFERER]

the-dream
03-24-2007, 10:52 PM
Unfortunately $HTTP_REFERER is not foolproof. Some browsers do not send this information, or can be made to send false information. You should keep this in mind when working with $HTTP_REFERER.

iLLin
03-25-2007, 12:09 AM
Use a session and setup tracking. :) Navigation History baby! OR just update the database with there history for every page they click if you dont want to use sessions. Thats fool proof :)

Use $_SERVER['REQUEST_URI']; for the "present" URL.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum