Jump to content

bigenner question


nahla123

Recommended Posts

Give each checkbox the same name. The name should be followed with square brackets. Example:

 

<input type="checkbox" name="example[]" value="box1" />
<input type="checkbox" name="example[]" value="box2" />

 

After the page is submitted, you will have a post array that holds an array called example. You can access it like this:

 

$_POST['example'][index]

 

It will hold all the values for the boxes that had checks in them. So if you were to check box one, then:

 

$_POST['example'][1]  would equal "box1".

Link to comment
https://forums.phpfreaks.com/topic/94224-bigenner-question/#findComment-482640
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.