gaza165 Posted October 8, 2008 Share Posted October 8, 2008 Hi everyone.... http://www.thedesignmonkeys.co.uk I have a login form on every page of my website on the nav bar.... this sends a request to another page and if the login is successful it returns them to the page i have set... which at the moment is the home page. What i want to be able to do is that... Say the login form has been submitted from the Portfolio page, if the login is successfull i want it to redirect back to the portfolio page. How can i pass the url to the login_script for it to pass the user back to whatever page they were on when they logged in.. Thanks Garry Link to comment https://forums.phpfreaks.com/topic/127475-passing-url-to-login-form/ Share on other sites More sharing options...
timmah1 Posted October 8, 2008 Share Posted October 8, 2008 Depending on how your login form is For my login script, I use a switch switch($_GET['ref']) { case "daily": header("Location: " . $config_basedir . "/daily.php"); break; case "portfolio": header("Location: " . $config_basedir . "/portfolio.php?s=$s"); break; case "weekly": header("Location: " . $config_basedir . "/weekly.php"); break; case "leader": header("Location: " . $config_basedir . "/leaderboard.php"); break; default: header("Location: " . $config_basedir); break; } What this is saying, is if the link was http://www.yoursite.com/leaderboard.php?ref=leader The login would redirect them to leaderboard.php after their logged in Link to comment https://forums.phpfreaks.com/topic/127475-passing-url-to-login-form/#findComment-659524 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.