note 22744 deleted from function.empty by dams

From: Date: Fri, 28 Jun 2002 17:11:11 +0000
Subject: note 22744 deleted from function.empty by dams
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-32377@lists.php.net to get a copy of this message
Just to save someone the hours of teeth-grinding I just went through, a CheckBox form field does NOT show up as set, if it is not checked. If you go to a page without submitting a form, $_POST["checkboxName"] will evaluate as the following: empty($_POST["checkboxName"]) == true isset($_POST["checkboxName"]) == false ("" == $_POST["checkboxName"]) == true If you then submit the form with $_POST["checkboxName"] UNclicked, it will evaluate as the following: empty($_POST["checkboxName"]) == true isset($_POST["checkboxName"]) == false ("" == $_POST["checkboxName"]) == true There is no difference as far as PHP is concerned. This is a pain in the butt for me, and hopefully it will be corrected sometime. I would *expect* that in the second instance, isset would be TRUE.

« previous php.notes (#32377) next »