Lets say, user go to “profile.php” page, but it requires login. Then it redirects to login page. But after login, it should redirect back to profile.php page. How do i do that?
How to get current URL in php?
$_SERVER[‘URI’]????
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Most sites simply pass a variable to the login form like this:
Then after the login is processed, it could redirect back to the page which returnUrl is pointing to. If there is no returnURl variable, then call the default one (index.php or default.php).
Hope this help.