<table>
<col width="250">
<col width="250">
<col width="250">
<tr><td>
<input type="checkbox" name="toppings[]"/>Pepperoni<br>
<input type="checkbox" name="toppings[]"/>Mushroom<br>
<input type="checkbox" name="toppings[]"/>Bacon
</td>
<td>
<input type="checkbox" name="toppings[]"/>Onion<br>
<input type="checkbox" name="toppings[]"/>Tomatoes<br>
<input type="checkbox" name="toppings[]"/>Olives
</td>
<td>
<input type="checkbox" name="toppings[]"/>Pineapple<br>
<input type="checkbox" name="toppings[]"/>Green Pepper<br>
<input type="checkbox" name="toppings[]"/>Extra Cheese
</td>
</tr>
</table>
$toppings = isset($_POST["toppings[]"]) ? $_POST["toppings[]"] : array("");
foreach($toppings as $chk => $selection){
echo $selection . ", ";
}
/*
For what ever reason my $selection value is always empty. The most I have ever gotten to print was the word "on" which would only be on if at least one of the checkboxes were checked off. I have attempted over 30 different solutions to iterating through checkbox arrays, but nothing seems to work. What am I doing wrong?
Sorry for the poorly formatted code, and thanks in advance for the help.
*/