I"m having trouble receiving a list of items that are checked in a field of checkboxes which are part of a form.
I have an HTML table with a few checkboxes:
HTML
<input type="checkbox" name="carry[]" value="1" />
<input type="checkbox" name="carry[]" value="2" />
<input type="checkbox" name="carry[]" value="3" />
PHP - this is what I'm using to post the form to an email address
foreach($_POST as $key => $val) {
$body .= $key . " : " . $val . "\r\n";
I get the value in my email as: "carry: Array" -- not the actual values that are selected. How do I handle an array of checkboxes selected in a form and post it?
Ideally, I would want: "carry: 1; 2; 3" (without the quotes)