Page 1 of 1

how to store the url completely in session

Posted: Tue Apr 10, 2007 1:25 am
by prasadc
i want to redirect the unsigned guests to login page, and after logging in i want to get them back to the previous page where they were...when i do this, i cant retain the variables in the previous url..how to achieve this?

im a newbee..pls help
TIA :?

Posted: Tue Apr 10, 2007 2:42 am
by Kieran Huggins
store the target URL in the $_SESSION array, like $_SESSION['onlogin_redirect']... then when the login is successful redirect them to the target URL.

Posted: Tue Apr 10, 2007 2:57 am
by prasadc
thnx Kieran

iam trying doing so..but how can i store the portion of the url after '?', i mean the variables..

any other way than '$_SERVER['PHP_SELF']' to get the complete url ??

Posted: Tue Apr 10, 2007 3:21 am
by Kieran Huggins
run phpinfo() to see a complete list of all the server variables available to you - you'll find the right one in there ;-)