I'm trying to check for the existence of a variable coming over the URL. If the variables isn't present, I want to redirect the user to another page. If it is present, I want to continue executing the page.
I am unable to get the condition to evaluate false.
<?php
$exist = isset($_GET["name"]); // isset() checks to see if $_get.name var exists
echo "exist outside: $exist";
var_dump($exist);
if ($exist != 1) // if var doesn't exist
{
//header ("LOCATION: list.php");
echo "exist inside: $exist";
//echo '<meta http-equiv="refresh" content="0; URL=list.php">';
}
?>