I'm trying to set up a page that is 'secure'. In other words users must be logged in in order to view that page, if not I want it to redirect them my login page.... but I want to keep the page that they are currently at saved in the url so once they do login it sends them on to the page they were trying to go to.
Now, I have made an If Else statement that works perfect, the problem that I am getting is trying to add the source value to the url, and I am getting errors on it. Any help would be appreciated.
This is my statement, and as I said it works perfectly.... but now that I am trying to add the $src value to the url when you get forwarded is where I am having a problem
if($_SESSION['identity']){
//If user is logged in, do nothing, let them goto the next page.
}else{
//If the user is not logged in, redirect the User to the login page
$_GET['src'];
header("Location: ../cgi/login.php?src="echo urlencode($_GET['src'])"");
exit;
}