So I have created a simple form for registrations. Everything works perfectly except for the check boxes. They do not seem to show in the E-mail that is sent to the recipient.
Here is the HTML form section:
<input type="checkbox" class="radio" name="projectType[]" value="Logo/Identity System" required/>Logo/Identity System<br />
<input type="checkbox" class="radio" name="projectType[]" value="Poster" required/>Poster<br />
<input type="checkbox" class="radio" name="projectType[]" value="Brochure" required/>Brochure<br />
<input type="checkbox" class="radio" name="projectType[]" value="Ad Campaign" required/>Ad Campaign<br />
<input type="checkbox" class="radio" name="projectType[]" value="Website" required/>Website<br />
<input type="checkbox" class="radio" name="projectType[]" value="Other" required />Other<br />
Here is the PHP section:
<?php
$to = '[email protected]';
$projectType = $_POST['projectType'];
$body = "Project Type:$projectType\n"
if ($_POST['submit']) {
if (mail ($to, $body)) {
echo '<p>You have successfully registered for 2014 Designathon!</p>';
} else {
echo '<p>Something went wrong, go back and try again!</p>';
}
}
?>
When the button submit is pressed all the information is sent but the "Project Type:" comes in empty with no value. How can I get it to show the values of the checkboxes selected? Don't mind the class "radio" They were previously radio buttons which worked fine but the client wanted multiple selections.
;at$body = "Project Type:$projectType\n"and make sure your submit button is namedsubmitbut won't make it an answer, fearing it's a typo.