Hello all. I am looking to create script will detect the page from which the user just came so that after they do something on the current page (login) it will send them back to the page they wanted. I was thinking about $_SERVER['HTTP_REFERER'], but php.net says:
'HTTP_REFERER'
The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.
Is this a big problem? Is there another technique I could use?
I would not rely upon REFERER. You have a common function that you use to check for a valid login, right? Within that method/function, save the current request into the session before you redirect to the login page. Upon a successful login, check for a saved page in the session and if it's there, redirect to that page instead of the normal one.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php