php form checkbox

Handling checkbox in a PHP form processor

This tutorial will introduce HTML check boxes and how to deal with them in PHP. Single check box Let's create a simple form with a single check box. <form action="checkbox-form.php" method="post"> Do you need wheelchair access? <input type="checkbox" name="formWheelchair" value="Yes" /> <input type="submit" name="formSubmit" value="Submit" /> </form> In the PHP script (checkbox-form.php), we can get the submitted option from the $_POST array. If $_POST['formWheelchair'] is “Yes”, then the box was checked.

Continue Reading →