$date = date('M d Y');
<?php$EmailFrom = "TEST";$EmailTo = "XXX@gmail.com";$Subject = "Contact Us";$Name = Trim(stripslashes($_POST['Name'])); $Phone = Trim(stripslashes($_POST['Phone'])); $Email = Trim(stripslashes($_POST['Email'])); $Message = Trim(stripslashes($_POST['Message'])); // validation$validationOK=true;if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit;}// prepare email body text$Body = "";$Body .= "Name: ";$Body .= $Name;$Body .= "\n";$Body .= "Phone: ";$Body .= $Phone;$Body .= "\n";$Body .= "Email: ";$Body .= $Email;$Body .= "\n";$Body .= "Message: ";$Body .= $Message;$Body .= "\n";// send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");?><?php// CHANGE THE VARIABLES BELOW$EmailFrom = "TESTTHANK";$Subject = "Thank You";$Name = Trim(stripslashes($_POST['Name'])); $Email = Trim(stripslashes($_POST['Email'])); $date = date('M dd Y'); // prepare email body text$Body = "";$Body .= $date."\n";$Body .= "\n";$Body .= "\n";$Body .= $Name . ":";$Body .= "\n";$Body .= 'I am delighted you contacted us.';// send email $success = mail($Email, $Subject, $Body, "From: <$EmailFrom>");// redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.XXX.com\">";}else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";}?>
$date = date('M dd Y');
M d Y
M dd Y
Why am I getting two days?
----> Aug 2121 2012
These are the results I am getting on the right side below...
d 2121
DD TueTue
D Tue
dd 2121
I just want one day like Aug 21 2012 or Aug 21st 2012
Its right there in the code you posted - two 'd' (each two digit date).
d 2121
DD TueTue
D Tue
dd 2121
M d Ywill result in (something like) "August 22 2012", whereasM dd Ywill result in "August 2222 2012".Running the actual code you posted ("as-is," and corrected) produces these results as expected (yes, I tested it).