Hello I am very new to daniweb but have been using it for many years to help me learn web development. I am struggling with some code that I hope you guys might be able to help me with. I want to send checkbox data from a form my email address.
Form
<form name="feedback-form" id="feedback-form" action="" method="post">
Name: <input name="name" type="text" size="20" maxlength="30" class="required">
Email: <input name="email" type="text" size="20" maxlength="30" class="required">
Your favorite name?
<input type="checkbox" name="id[1]" value="1" /> Mike <br />
<input type="checkbox" name="id[2]" value="1" /> John <br />
<input type="checkbox" name="id[3]" value="1" /> George <br />
<input type="checkbox" name="id[4]" value="1" /> Jane <br />
<input type="checkbox" name="id[5]" value="1" /> Sarah <br />
</td></tr>
<input type="Submit" value="Send Message">
</form>
PHP
<?php
if ($_POST["email"]<>'') {
$ToEmail = 'EMAILADDRESS';
$EmailSubject = 'Video Feed Back';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY = "".$_POST["name"]." posted some feedback on Light Move Image. See The feedback below.<br>";
$MESSAGE_BODY .= "<b>Name:</b> ".$_POST["name"]."<br>";
$MESSAGE_BODY .= "<b>E-mail:</b> ".$_POST["email"]."<br>";
$MESSAGE_BODY .= "<b>Favourite Name:</b> ".$_POST["id"]."<br>";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
?>
I have tried to change the checkbox to an array but it is still not working. Does anybody have any ideas?