How to return users to the right page?
February 25, 2008 7:13 AM
Subscribe
How can I put a login box on every page of my website?
The site is coded in PHP and talks to a MySQL database, and it authenticates users perfectly, sets sessions and so on. The form to log in is on every page, and the action of the form is set to be $_SERVER['PHP_SELF'].
My header.php is included in every page, and contains the script to do all the logging in business. However, the URL to a page might be details.php?id=123, to see the details of an item. $_SERVER['PHP_SELF'] takes the user back to just details.php - is there any way to take them back to the page details.php?id=123?
posted by samstarling to computers & internet (5 comments total)
"http://" . $_SERVER['SERVER_NAME'] . $_SERVER['URL'] . "?" . $_SERVER['QUERY_STRING']
It depends on if the login will pass them back to that page though.
posted by jwells at 8:00 AM on February 25, 2008