The only possible way for that to succeed would be for $code to be 0 so that the initial term evaluates to false and short-circuits the &&. If you've forgotten to assign $code from $_POST["code"] that could also explain it as the undefined variable will default to false...
Its almost never correct to have
Code: Select all
if ($x!=1 || $x!=2)
// handle negative
as that will reduce to TRUE in all cases
Normally, you want to either do:
Code: Select all
if ($x==1 || $x==2)
// handle positive
else
// handle negative
or
Code: Select all
if (!($x==1 || $x==2))
// handle negative
else
//handle positive
Using DeMorgan's on the last example would yield
Code: Select all
if ($x!=1 && $x!=2)
// handle negative
else
// handle positive
(which matches what feyd was suggesting.)