Click to See Complete Forum and Search --> : Checking previous page


chong
07-28-2005, 02:39 AM
Hi, Is there a simple function that checks which page the current page is being redirected from?

ie. if a person is in A.php when it redirects him to B.php, then the function in B.php will show A.php

I would hate to resort to passing variables from A.php to B.php

TIA :)

NogDog
07-28-2005, 04:27 AM
The pre-defined variable $_SERVER['HTTP_REFERER'] will tell you. However, it's set by the client, so you can't 100% depend on it being populated or correct. (If you're running an intranet app., you can probably depend on it if the users' PCs are reasonably well controlled.)