Lucky2710 Posted November 1, 2010 Share Posted November 1, 2010 I currently have a login script in place on my site and to get to certain pages you have to be logged in to get to. So when a user tries to go to one of those pages and is not logged in it sends them to the login page (which is great) But on the login page once they login it uses " header('Location: index.php') " to automatically send them to the index page logged in. How can i dynamically see what page they are coming from that way when they login I can send them back to where they where trying to get to to begin with. (like if they click on "Profile" and they are not logged in it sends them to "login" then they login and it currently sends them to "index" I want it to dynamically know to send them back to "profile" instead) If this doesn't make sense and i will try and explain it better But if you understand and know how to do this please help Thanks ahead of time! Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted November 1, 2010 Share Posted November 1, 2010 store the last URL visited in a session variable, send them there after login. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.