Jump to content

Passing URL to login form...


gaza165

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.