I have a form that is submited to PHP, PHP evaluates it and sends it to my database. How do I get the value of a checkbox as 0 or 1? I used import_request_variables to get the data and it always returns 0.
Heres an example: Your html form should contain the following... <input type= 'checkbox' name='test' value="0">Test 0 <input type= 'checkbox' name='test' value="1">Test 1 Your php... <?php //will display the checked value (0 or 1)... echo $_POST['test']; //check if value is 0... if($_POST['test'] == 0){ //its 0 thats selected... } ?> PHP: