capturing redirect query strings
Posted: Thu Nov 27, 2003 9:51 am
Hey ppl,
The following code redirects a user to a login form if a session isnt present
in the login form page
how ever in running a request with a paramters script.php?redirect=page.php?param=1¶m=2¶m=3
how do you guys handle redirecting situations?
the thing is i want the person to be able to go back to the way he was before he had to go log in and stuff after he logs in
Kendall
The following code redirects a user to a login form if a session isnt present
Code: Select all
if(!session_is_registered('User')){
$query = $_SERVER['QUERY_STRING'];
header('Location: login_form.php?redirect=post_message_form.php?'.$query);
}Code: Select all
if($_REQUEST['redirect'])
$redirect = $_REQUEST['redirect'];
else $redirect = $PHP_SELF.'?'.$_SERVER['QUERY_STRING'];so what happens to the rest?$redirect = page.php?param=1
how do you guys handle redirecting situations?
the thing is i want the person to be able to go back to the way he was before he had to go log in and stuff after he logs in
Kendall