trouble in email with php and js datepicker
Posted: Thu Apr 07, 2011 10:20 am
Hi all,
i'm using a js datepicker in a form, but when I receive the mail with the form datas, the dates are numbers like 1302000813 and i cannot understand!
here is the code of my php file:
where i'm wrong? thanks
ps i tried to change something putting
$body .= "entrydate: " . trim(date($_POST["entrydate"])) . "\n";
$body .= "goingoutdate: " . trim(date($_POST["goingoutdate"])) . "\n";
but is the same...
thanks again
Kecco
i'm using a js datepicker in a form, but when I receive the mail with the form datas, the dates are numbers like 1302000813 and i cannot understand!
here is the code of my php file:
Code: Select all
<?php
$to = "my@email.com";
$subject = "Subject";
$body = "Content:\n\n";
$body .= "name: " . trim(stripslashes($_POST["name"])) . "\n";
$body .= "surname: " . trim(stripslashes($_POST["surname"])) . "\n";
$body .= "email: " . trim(stripslashes($_POST["email"])) . "\n";
$body .= "phone: " . trim(stripslashes($_POST["phone"])) . "\n";
$body .= "entrydate: " . trim(stripslashes($_POST["entrydate"])) . "\n";
$body .= "goingoutdate: " . trim(stripslashes($_POST["goingoutdate"])) . "\n";
$body .= "writeus: " . trim(stripslashes($_POST["writeus"])) . "\n";
$headers = "From: Reservation";
if(@mail($to, $subject, $body, $headers)) {
echo "Your email has been sent correctly. Thank you!";
} else {
echo "There was a problem while sending the mail. Please contact us. Thank you!";
}
?>ps i tried to change something putting
$body .= "entrydate: " . trim(date($_POST["entrydate"])) . "\n";
$body .= "goingoutdate: " . trim(date($_POST["goingoutdate"])) . "\n";
but is the same...
thanks again
Kecco