So that in PHP I can deal with them as :
foreach($_POST['checkboxname'] as $i => $value)
...
So that in PHP I can deal with them as :
foreach($_POST['checkboxname'] as $i => $value)
...
Like this:
<input type="checkbox" name="checkboxname[]" />
<input type="checkbox" name="checkboxname[]" />
<input type="checkbox" name="checkboxname[]" />
<input type="checkbox" name="checkboxname[]" />
<input type="checkbox" name="checkboxname[]" />
Just append [] to their names.
Do something like this:
<input type="checkbox" name="checkboxArray[]" />
Note the [] in the name.
for those HTML form elements that can send multiple values to server (like checkboxes, or multiple select boxes), you should use an array like name for your HTML element name. like this:
<input type="checkbox" name="checkboxname[]" />
also it is recommended that you use an enctype of "multipart/form-data" for your form element.
<form enctype="multipart/form-data" action="target.php" method="post">
then in your PHP scripts you can access the multiple values data as an array, just like you wanted.