<snip> The problem I'm having right now is that after the user is logged in, the login.php can never send it back to the page the user came from, it will just redraw the login.php page. Obviously, $_SERVER['HTTP_REFERER'] contains the location of itself instead of the location of the page sent the user here. </snip>
That would make sense as after a form submission has been done the new referring url would be the page the form was submitted from (hence the login.php). What you need to do is either embed the HTTP_REFER on the login page either via a hidden field in the form, or through a session variable or even a cookie. Basically you need to temporarily store where the user originally came from so then after the submission from the login.php page, you can grab what the old referring URL was and redirect the user to the proper site. Also keep in mind that some browsers do not pass referring URLs at all, and some browsers (such as AOL) do not pass referring URLs if the page now being access was opened up in a new window. You may want to prepare for the potential of not having a referring url be passed occasionally as well. Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php