mickapoo
19 May 2009, 03:32 PM
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.
The form sends data using 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 already get sent to my email address, I'm just trying 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 Bellamy 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://bellamymansion.org/weddings/ ";
mail($email, "Bellamy Mansion: Auto-Acknowledgement", $mail_user,
"From: Bellamy Mansion<'weddingcenter@bellamymansion.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!
The form sends data using 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 already get sent to my email address, I'm just trying 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 Bellamy 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://bellamymansion.org/weddings/ ";
mail($email, "Bellamy Mansion: Auto-Acknowledgement", $mail_user,
"From: Bellamy Mansion<'weddingcenter@bellamymansion.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!