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! Link to comment https://forums.phpfreaks.com/topic/217499-header-question/ 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. Link to comment https://forums.phpfreaks.com/topic/217499-header-question/#findComment-1129217 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.