I have a website which has a web page containing list of logs. Now I usually give the link to access that page for some user eg : http://172.20.22.77/someapp/results.htm?id=45
Now when some user clicks on this .It would give him a login screen .But after login it does not go to the page that was intented . I am using sessions to implement the website and it has many pages, hence session is used to track the user browsing the page.
kindly let me know how can i redirect the URL being asked after user logs in .
http://php.net/manual/en/function.header.php
You can save the URI in the session and before the login simply make the redirection:
Put the URL the user was accessing in the session before redirecting to the login page. The login page can then redirect back to that stored URL after authenticating the user.
On the page that needs logging in:
On the login page:
Use this on protected page to save the current page url and query string to the session.
Use this after successfull login to redirect the user to the page stored in the session.