Forum Moderators: coopster
However, the checkbox values don't behave as I expected (I'm used to asp, and getting a comma seperated list).
After reading posts here and elsewhere, this is what I have. It's so close, and gets the job done, but I suspect it's not quite how it should be. I hoped to loop through the array and concatenate the results into one string, so that I could add just that one string to my message string.
Any one spot what I could do differently?
From the form:
<input type="checkbox" name="someitems[]" value="First Item"> First Item
<BR><input type="checkbox" name="someitems[]" value="Another Item"> Another Item
<BR><input type="checkbox" name="someitems[]" value="Someother Item"> Someother Item
...etc
From the mail sending page:
$msgA = "Some message.\n";
$msgB = "\nItems Selected:\n " . $someitems[0] . ", " . $someitems[1] . ", " . $someitems[2] . ", " . $someitems[3] . ", " . $someitems[4] . ", " . $someitems[5] . ", " . $someitems[6] . ", " . $someitems[7] . ", " . $someitems[8] . ", " . $someitems[9];
$msg = $msgA . $msgB;
mail($to, $subject, $msg, "From: asdf@somedomain.com") ;
Crude, but it works.
I tried looping and could echo the values ok, but didn't find the way to save those values to a variable that I could add to the message variable.
for($i=0; $i<count($someitems); $i++) echo $someitems[$i];
Thanks.