Page 1 of 1

php self -1?

Posted: Fri Mar 12, 2010 3:51 pm
by scarface222
Hey just a quick question for anyone who knows, currently I am using a PHP_SELF to redirect users on login however it kind of backfires on one page. I noticed this forum has it so that if you are in a topic, you click to login, then it does not redirect to the index or login page but to the topic itself. Does anyone know how to accomplish this. Currently I am using the following script and on my login page it just redirects me to my login page. Also, when I have multiple tabs open, on another tab it may direct me to a page I did not intend.

Code: Select all

$this->url = $_SESSION['url'] = $_SERVER['PHP_SELF'];

Re: php self -1?

Posted: Sat Mar 13, 2010 10:16 am
by scarface222
Ok never mind I figured it out. I just put a session variable on most pages and made that the default selection to go to if the variable isset, else go to index. I am just still a little scared of sessions so sometimes I do not think of the obvious solution, but I am learning more about them and feeling more comfortable with them.