That manual section explains it all:
http://www.php.net/manual/en/languag...oolean.casting
So if you have a string "0" and do an implicit cast to boolean (in the if statement), you've got bad luck. Try to use strlen() to determine if a string length is greater than 0 - which indicates that the user has set a value for this input field.