contact form not sending checkbox
Hi im having a problem with a website im building and testing.
in the contact form when i fill out the form and check some of the checkboxes, i recieve a email with the form info but the check boxes are empty.
can anyone help??
Also just discovered my selectable dropdown menu is only sending 1 of the selected items
Thanks in advance
html code:
<th>Membership * </th>
<td>
<input type="checkbox" name="membership[]" value="ecssa">ECSSA<br />
<input type="checkbox" name="membership[]" value="psa">PSA<br />
<input type="checkbox" name="membership[]" value="nsai">NSAI<br />
<input type="checkbox" name="membership[]" value="eqa">EQA<br />
<input type="checkbox" name="membership[]" value="Other">
Others (Fill Below) <br />
</td></tr>
contact php:
<?php
$field_name = $_POST['cf_name'];
$field_phone = $_POST['cf_phone'];
$field_mobile = $_POST['cf_mobile'];
$field_email = $_POST['cf_email'];
$field_company = $_POST['cf_company'];
$field_services = $_POST['services[]'];
$field_other = $_POST['cf_other'];
$field_areas = $_POST['cf_areas'];
$field_membership = $_POST['membership[]'];
$field_othermember = $_POST['cf_othermember'];
$field_job = $_POST['cf_job'];
$field_leads = $_POST['leads[]'];
$field_agree = $_POST['agree[]'];
$mail_to = 'Removed';
$subject = 'Message from a site visitor '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Phone Number: '.$field_phone;
$body_message .= 'Mobile: '.$field_mobile;
$body_message .= 'Company Name: '.$field_company;
$body_message .= 'Services offered: '.$field_services;
$body_message .= 'Other Services: '.$field_other;
$body_message .= 'Areas will Work: '.$field_areas;
$body_message .= 'Membera of: '.$field_membership;
$body_message .= 'Other Membership: '.$field_othermember;
$body_message .= 'Job Min Value: '.$field_job;
$body_message .= 'Recieve leads: '.$field_leads;
$body_message .= 'Agree to terms: '.$field_agree;
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message\n $check_msg";
$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'index.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to removed');
window.location = 'index.html';
</script>
<?php
}
?>