estreetfan999
-
Posts
3 -
Joined
-
Last visited
Never
Posts posted by estreetfan999
-
-
Thanks.
I'm using an include file, which has this redirect code in it.
<?php require_once('include-test.php'); ?>
Placed this include file at the very top of somepage.php
I added the quotes around 'PHP_SELF'
Still going to second link and ignoring the first link.
-
Hi,
Why doesn't this work? Driving me nuts! Thanks.
<?php
if($_SERVER[php_SELF] == 'somepage.php')
{
Header("Location: http://www.thissite.com");
} else {
Header("Location: http://www.anothersite.com");
}
?>
The code NEVER redirects to the first URL (thissite.com). It ALWAYS redirects to the second URL (anothersite.com).
What the heck am I doing wrong?
Redirect from header with conditional statement
in PHP Coding Help
Posted
Yes. Just did.
Thanks so much. That was the answer.
($_SERVER[php_SELF] == 'somepage.php') was actually going to /solutions/somepage.php (that's my file structure)
It all works now. Really appreciate the help.