Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
07-26-2007, 11:52 PM #1
- Join Date
- Sep 2006
- Thanked 0 Times in 0 Posts
Need help getting proper page to display after login
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 #2
- Join Date
- Dec 2004
- In a place far, far away...
- Thanked 1,043 Times in 1,019 Posts
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.