View Full Version : Need help getting proper page to display after login

07-26-2007, 11:52 PM
If a user pastes a session-needed url into into their address bar, they'll hit the page and the script checks to see the logged in value in the cookie. If it's set, the pages loads, if it's not set user gets the login form.

OK, all fine, but once the user logs in, they hit a welcome page instead of the initial URL they entered to the address bar.

Any ideas on how to store this URL value they enter? And write in php, if this value is not null... display this page... otherwise if null display the welcome page?

07-27-2007, 01:47 AM
What I do on one of my sites is I set a session for the user using
[php]$_SESSION['goto'] = $_SERVER['REQUEST_URI'];[/code]
This way on the page that they enter, it will save the url, after they log in you can check to see if the session is set by using isset. If its set then use the php header() to redirect them to the value of the session, if its not set redirect them to the welcome page.