You just have a logical error. When you say not equal to "0 or 1", what you mean is not equal to 0 and not equal to 1. This code fixes the problem and demonstrates it working as described:
PHP Code:
<?php if (($_POST['active'] != 0) && ($_POST['active'] != 1)) { echo "Is NOT 0 or 1"; } else { echo "Is 0 or 1"; } ?> <form method="post"> <select name="active"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> </select> <input type="submit" value="Check" /> </form>
Also, it's $_POST, not $POST.
__________________
Jeremy Miller
Please login or register to view this content. Registration is FREE
Last edited by JeremyMiller; 02-02-2008 at 11:30 AM..
|