I have 1 form in with multiple checkboxes in it (each with the code):
This code displays all selected value on front page and only last selected to my email but I want to receive all the selected option on my email address.
<form action="test.php" method="post">
<input type="checkbox" name="check_list[]" value="value 1">
<input type="checkbox" name="check_list[]" value="value 2">
<input type="checkbox" name="check_list[]" value="value 3">
<input type="submit" />
</form>
<?php
if(!empty($_POST['check_list'])) {
foreach($_POST['check_list'] as $check) {
echo $check;
}
}
?>
$email_message = '<p><b>Your Career Interest :</b> '.$checks .'</p>
You can use the implode function in PHP to include all items in an array separated by a certain character like so
This prints out: Your Career Interests: test, test2, test3. I didn't go through the process of creating an HTML form and sending POST data just to give you an example, but the idea is the same.