I have an HTML form that I added a js calendar function to. The user can click the calendar icon, then click on the date that he or she wants from the calendar that pops up. The date that they select is then displayed in the date field. In this form is also a field for them to enter their name and email address.
The form gets posted to a php script. My question is, what do I need to do so that the date that is entered will also get sent to my email address? I'm not sure what I need to do to my php file to get the date sent along with the other fields. The name and email address are already sent to my email address, I just need to get the date sent as well.
This is my form:
<form name="frm" method="post" action="exe_tour2.php" onSubmit="return chk();">
<tr>
<td width="17%">Name:</td>
<td width="83%"><input type="text" name="name" id="textfield"></td>
</tr>
<tr>
<td>Email address:</td>
<td><input type="text" name="email" id="textfield2"></td>
</tr>
<tr>
<td>Preferred wedding date:</td>
<td><script>DateInput('orderdate', true, 'DD-MON-YYYY')</script>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="button" id="button" value="Book It"></td>
</tr>
</form>
and this is my php code:
<?php
$mail_msg = $mail_msg."Contact Information\n\n";
$mail_msg = $mail_msg."Name: ".$_POST["name"]."\n";
$mail_msg = $mail_msg."Email Address: ".$_POST["email"]."\n";
$email = $_POST['email'];
mail('email@myemail.com', 'Tour Request', $mail_msg,
"From: <".$email.">\n\r");
// Mail to user
$mail_user = "Auto-Acknowledgement:\n\n Thank you for contacting Mansion.\n We are in receipt of your e-mail and will respond to your inquiry shortly. \n\n Thank you for visiting at http://mansion.org/weddings/ ";
mail($email, "Mansion: Auto-Acknowledgement", $mail_user,
"From: Mansion<'weddingcenter@mansion.org'>\n\r");
header("Location: thanks.htm");
?>
I'm not sure if I posted everything I need to or not. Don't know if the js file needs to be amended, if so, I can attach it.
Thank you for your help!