dspiessens
07-16-2009, 06:01 PM
Hi all,
I'm a newbie to php and programming for that matter. I have a script on my page that is suppose to check what page in my site the user came from. If the user came from 1 of 4 specific pages, then something will display. This is what I have so far, but it is not working correctly. It is saying that I came from a blue page even when I did not. Does anyone know what I am doing wrong?
<?
$blue_pages[] = "blue1.php";
$blue_pages[] = "blue2.php";
$blue_pages[] = "blue3.php";
$blue_pages[] = "blue4.php";
if ( $_SERVER['HTTP_REFERER'] == $blue_pages )
echo "You came from a blue page";
else
echo "You DID NOT come from a blue page";
?>
I'm a newbie to php and programming for that matter. I have a script on my page that is suppose to check what page in my site the user came from. If the user came from 1 of 4 specific pages, then something will display. This is what I have so far, but it is not working correctly. It is saying that I came from a blue page even when I did not. Does anyone know what I am doing wrong?
<?
$blue_pages[] = "blue1.php";
$blue_pages[] = "blue2.php";
$blue_pages[] = "blue3.php";
$blue_pages[] = "blue4.php";
if ( $_SERVER['HTTP_REFERER'] == $blue_pages )
echo "You came from a blue page";
else
echo "You DID NOT come from a blue page";
?>