How to submit check boxes from a form

A

Anonymous

Guest
Either you must give each checkbox a different name, e.g.:

Code:
<input type="checkbox" name="mybox1">
<input type="checkbox" name="mybox2">
...

Or you have to make an array from the checkbox values. This is done by putting "[]" at the end of the name in the HTML form:

Code:
<input type="checkbox" name="mybox[]">
<input type="checkbox" name="mybox[]">
...

This will store all of the checkbox values in an array which may be accessed by $_REQUEST['mybox'];
 
Back
Top