Hello DaniWebbers,
I've got several href's that take the user to different forms. However, in order to have access to the forms, they have to log in. So when they click the link, they are redirected to a login page if they have not already logged in, otherwise they are taken directly to the form. The problem is, that after they log in I am having trouble devising a plan that gets them to the original page (the form) in the HREF. I know I need to pass a variable through the URL which I can use to redirect them later, I am just not sure exactly how to go about this.
Here is my theory: create a .php file that will hold an array of possible redirect destinations, say:
$page = array(
'1' => '/home/register.php',
'2' => '/home/adduser.php',
'3' => '/home/request_form.php',
'4' => '/home/music.php','
);
if(isset($_GET['go']) )
{
$redirect = $page[$_GET['go']];
}
Then in the href use a GET to create a variable like so http://mysite.com?go=1
Which should turn the URL into a session variable right? I am not sure if the syntax is correct, this is all theory lol. Or is there an easier way to do this? Any suggestions are appreciated.
EDIT: I just realized that using this method I will also need to echo the value to the browser.