> I am having some difficulty getting a list of check boxes to work > properly. I have dug through the list archives, usenet, PHP Manuals, > etc. and still I am unable to process multiple checkboxes from a form > submission properly. The following is what I am running into. > > Form: > <input name="add" type="checkbox" id="add[]" value="179"> > <input name="add" type="checkbox" id="add[]" value="409"> > <input name="add" type="checkbox" id="add[]" value="2090"> > > PHP: > for ($i = 0; $i < count($_POST['add']); $i++) > { > echo $_POST['add'][$i]; > echo "<br>\n"; > } > > Output: > 2 > 0
The name attribute should be "add[]", not the ID. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php