I have a series of 5 checkboxes installed in a web form. I have the code to get the checkboxes to echo back onto a confirmation page for the site visitor to see. However I can't get the info to come back to me in the email. I don't know what code to insert into the $msg for the $servicename checkboxes to come to me in email. The closest I've gotten has been to get the email to tell me that there is an array, but it doesn't tell me the checked components of the array.
Here is my PHP code.
$service=$_POST['service'];
(I have omitted the other variables to save space here)
$to = 'amisenheimer@hotmail.com';
$subject = 'Inquiry';
$msg = "$name would like to be contacted by you.\n" .
"Phone number: $phone.\n" .
"Mailing Address: $address.\n" .
"City/State/Zip Code: $citystatezip.\n" .
"Other comments: $other";
mail($to, $subject, $msg, 'From: ' . $email);
echo 'Thanks ' . $name . ' for submitting your information.<br />';
echo 'Your email address is ' . $email . '.<br />';
echo 'Your phone number is ' . $phone . '.<br />';
echo 'Your mailing address is ' . $address . ', ' . $citystatezip . '.<br />';
foreach ($service as $servicename)
{
echo "$servicename is checked. ";
}
echo '<br />You added the following information: ' . $other . '<br /><br />';
?>