I have implemented a form that sends submitted information to my email successfully. I can achieve this with all inputs except for checkboxes. What do I have to do in order for checkbox values to appear in my email as well? I have tried to use a for each loop but I dont know if I am along the right lines. Relevant code below:
Code:
$companyname = $_POST['companyname'];
$fullname = $_POST['fullname'];
$email = $_POST['email'];
$phonenumber = $_POST['phonenumber'];
foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value\n";
}
$to = 'woodsy0130@hotmail.com';
$subject = 'Quote';
$message = 'Company Name: '.$companyname. "\n"."\n". 'Full Name: ' .$fullname. "\n"."\n". 'E-mail: '.$email. "\n"."\n". 'Phone Number: '.$phonenumber. "\n"."\n". 'Features: '$check_msg;
HTML:
<label><input type="checkbox" name="check[]" id="q12_1" value="E commerce Shopping Cart" />E-commerce (Shopping Cart)</label>
<label><input type="checkbox" name="check[]" id="q12_2" value="Content Management System CMS" />Content Management System (CMS)</label>