hi,
i got some issues with my contact form.
basically i fill in the form and it gets emailed back with all information but no check boxes are being registered.
Below is the code for the contact form:
<form method="post" action="sendtraining.php">
<p>
<label>Department:</label>
<select name="sendto">
<option value="jasonshico@live.com.au" selected="selected">Training Department</option>
</select></label>
<br />
<label><span class="style1">*</span> Name</label>
<input name="Name" value="Your Name" type="text" size="30" />
<label><span class="style1">*</span> Company Name</label>
<input name="Company" value="Company Name" type="text" size="30" />
<label><span class="style1">*</span> Email</label>
<input name="Email" value="Your Email" type="text" size="30" />
<label><span class="style1">*</span> Phone Number</label>
<input name="Phone" value="Your Phone Number" type="text" size="30" />
<label>Additional Training Modules </label>
<input type="checkbox" name="check[]" value="y" />
Reporting<br />
<input type="checkbox" name="check[]" value="y" />
Advanced Stock Management (Promotions, Audit trails, Deletions, Transfers etc.)<br />
<input type="checkbox" name="check[]" value="y" />
POS Training overview<br />
<input type="checkbox" name="check[]" value="y" />
Customer Managment (Special pricing, loyalty, customer profiling)
<br />
<label>Other (Please specify below) </label>
<textarea name="Message" rows="5" cols="5"></textarea>
<br />
<input type="submit" name="send" value="Submit" />
<br />
<span class="style1">*</span> Iindicates a
field is required</p>
</form>
and here is the php script file:
<?php
$to = $_REQUEST['sendto'];
$from = $_REQUEST['Email'];
$name = $_REQUEST['Name'];
$company = $_REQUEST['Company'];
$phone = $_REQUEST['Phone'];
$headers = "From: $from";
$subject = "RetailCare.com.au - Free Consulting Session - Conctact Form";
$fields = array();
$fields{"Name"} = "Name";
$fields{"Company"} = "Company";
$fields{"Email"} = "Email";
$fields{"Phone"} = "Phone";
$fields{"Message"} = "Message";
$check_msg .= "Checked: $value\n";
$body = "We have received the following information:\n\n";
foreach($fields as $a => $b)
{
$body.=sprintf("%20s: %s\n",$b,$_REQUEST[$a]);
}
$headers2 = "From: noreply@retailcare.com.au";
$subject2 = "Thank you for contacting us";
$autoreply = "Thank you for for your query. A Sales representitive will be in contact with you shortly!.";
if($from=='') {print "You have not entered an email, please go back and try again";}
if($name=='') {print "You have not entered a name, please go back and try again";}
if($phone=='') {print "You have not entered a phone number, please go back and try again";}
if($company=='') {print "You have not entered a company name, please go back and try again";}
else
{
$send = mail($to, $subject, $body, $check_msg, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
{
header("Location: http://www.retailcare.com.au/thankyou.html");
}
else
{
echo "We encountered an error sending your mail, please notify sales@retailcare.com.au";
}
}
?>
Can someone please take a look and see what im doing wrong?
It would be very much appreciated.
Thanks.
Jase.