View Full Version : previously visited page
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.
03-24-2007, 07:43 PM
Use the superglobal to know where they came from:
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.
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.