Large_Farva
asked on
Redirect once (per session) from body tag
There is one page I need redirected but only on first load in a session. The header file is site-wide so I feel like I am limited to the body tag for this.
Thanks!
Thanks!
ASKER
Any issues with this being in the global header file within template...this is a cms?
ASKER
As you can tell, I am new to sessions...it looks like the "if" statement there is saying "if this page has been redirected, then send them here".
should
should
$_SESSION['redirected'] = true;
be set to "false" if I don't want it to redirect after the first time?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
$_SESSION['redirected'] = true; is just setting the variable with a value. The line preceding it basically says 'if the redirected variable isn't already set, then set it and redirect.
That line could just as well say $_SESSION['redirected'] = "Yes Siree Bob!";
You don't need to check the value - just that it has been set to something
That line could just as well say $_SESSION['redirected'] = "Yes Siree Bob!";
You don't need to check the value - just that it has been set to something
ASKER
Thanks!
Open in new window