Hi,
If I leave out the ?name= from logic.php it correctly displays "no name specified." But if I do logic.php?name=Jack it displays wrong name. Same with a bogus value. I tried changing the operator to !=, but the code outputs "name accepted" for any value using this method.
I would appreciate any tips with this.
Code:
<?php
$var = $_GET["name"];
if (!$var)
{
echo "no name specified";
}
else
{
if ($var !== ("Jack" || "Jill" || "Ted" || "Sarah"))
{
echo "wrong name";
}
else
{
echo "name accepted";
}
}
?>