simple PHP if statement question
Posted: Sat Sep 04, 2010 10:11 am
I've simplified the following code just to get an understanding why the code is executed this way. This code will redirect to pagetwo.php instead of executing the if statement and redirecting to pageone.php. Why is this? I know it's easy to have pagetwo.php in an else statement and all will be fine but I'm curious why it wouldn't work this way also.
Code: Select all
$check = 1;
if ($check == 1)
{
header("Location: ../pageone.php");
}
header("Location: ../pagetwo.php");