[SOLVED] HELP NEEDED - Comparison operator not working
Posted: Thu Jul 15, 2004 6:16 pm
I am trying to force a page to load only when a certain query string is valid and only when the passed value is a certain value. I am using an if statement which works almost completely. The problem I am getting is that the value '0' (the number zero) should not be allowed to load the page. But when I enter it in the query string, the page loads anyway. All other 'unacceptable' values are kicked out and the result is what you would expect when looking at the code. Can someone please tell me what I am doing wrong? Thanks for all your help.
PS I have tried changing the comparison on the 'zero' issue. Using greater thans, less thans or equals to has yielded the same result.
Code: Select all
<?php
if ( !(isset($_GET['dealer'])) || ($_GET['dealer'] >= 3) || ($_GET['dealer'] == 0) || !(is_numeric($_GET['dealer'])) )
{
header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "dealers.php");
exit();
}
?>