Then this may show you one way of doing it, DO NOT USE this script as is, it is just a guideline and has none of the essential security points coded in and as such is untested.
You will need to have a mail server installed and configured for the [man]mail()[/man] function to work.
<?php
if(isset($_POST['submit'])){
$from = $_POST['author'];
$email = $_POST['email'] ;
$phone = $_POST['phone'];
$date1 = $_POST['datepicker'];
$date2 = $_POST['datepicker2'];
$interests = "Interests:\n";
if(isset($_POST['snorkel'])){
$interests.= $_POST['snorkel']."\n";
}
if(isset($_POST['hiking'])){
$interests.= $_POST['hiking']."\n";
}
if(isset($_POST['biking'])){
$interests.= $_POST['biking']."\n";
}
if(isset($_POST['bird'])){
$interests.= $_POST['bird']."\n";
}
if(isset($_POST['exploring'])){
$interests.= $_POST['exploring']."\n";
}
if(isset($_POST['kayaking'])){
$interests.= $_POST['kayaking']."\n";
}
if(isset($_POST['beach'])){
$interests.= $_POST['beach']."\n";
}
if(isset($_POST['caving'])){
$interests.= $_POST['caving']."\n";
}
if(isset($_POST['fishing'])){
$interests.= $_POST['fishing']."\n";
}
if(isset($_POST['other'])){
$interests.= $_POST['other']."\n";
}
$text = $_POST['text'];
$message = 'Email from: '.$from."\n
Email address: ".$email."\n
Telephone Number: ".$phone."\n
Date from: ".$date1."\n
Date to: ".$date2."\n
".$interests."\n
Message: ".$text;
$to = 'nobody@example.com';
$subject = 'Reservation Contact';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
}
else {
?>
YOUR ORIGINAL HTML CODE GOES HERE
<?php
}
?>
You will also need to change the action attribute of the form tag to direct it to the same page for processing like
<form id="contact_form" action="" method="post" enctype="multipart/form-data">
and add a name attribute to the datepicker fields like
<input id="datepicker" type="text" name = "datepicker">