how to store the url completely in session

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
prasadc
Forum Newbie
Posts: 2
Joined: Tue Apr 10, 2007 1:11 am

how to store the url completely in session

Post 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 :?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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.
prasadc
Forum Newbie
Posts: 2
Joined: Tue Apr 10, 2007 1:11 am

Post 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 ??
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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 ;-)
Post Reply