Hello I have a very simple html/PHP email form, it worked fine until I added check boxes to my form and tried to get them to submit with all the other information. Now it is not sending an email to the address at all. Another change I made is that instead of my html action being action="mail.php" I changed it to link to a thank you page, so action="thankyou.html." Would that be messing anything up? I am not very good with PHP so if anyone could give advice it would be much appreciated, thank you in advance
HTML
<form action="mail.php" method="POST">
<p>Name</p>
<input type="text" name="name">
<p>Email</p>
<input type="text" name="email">
<p>Phone Type: Apple/Android/other</p>
<input type="text" name="phone">
<p>Interested in BETA testing?<br><span style="font-size:9pt; font-weight: 300;">(Win prizes! Have fun! Be invited to excluseive Dapp parties! It's super easy and you can opt out at any time)</span></p>
<div class="checkbox">
<input type="checkbox" name="check[]" value="YES" checked>
<label for="option1">Yes</label>
<input type="checkbox" name="check[]" value="NO">
<label for="option2">No</label>
</div>
<button type="submit" name="submit" value="submit" style="margin-top:15px">Dapp us up!</button>
</form>
PHP
<?php
if(isset($_POST['submit']))
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value\n";
}
$body = "From: $email\n Phone: $phone\n BETA:\n $value\n $check_msg";
$to = "dappusup@gmail.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
if ($_POST['submit']) {
if (mail ($to, $subject, $body, $mailheader)) {
echo 'Your message has been sent!';
}
}
header("Location: thankyou.html");
exit();
?>