Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

How to submit check boxes from a form

General discussions related to php

Moderators: macek, egami, gesf

Postby swirlee » Wed Jul 09, 2003 10:03 am

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

Code: Select all
<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: Select all
<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'];
User avatar
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Return to PHP General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.