How do I get a php email to post the date at the end of it?

Eric K

New member
$msg .= "Checked by ". $_POST[check] . ",\n\n" . "on " . date("l F d, Y, h:i A") . ;


how do i get it to post the date after the "on?"
 
Learn the parameters of "date()" from http://www.php.net, and correct your mistake of $_POST:
==> $_POST [ ' check ' ] !
("check" must be enclosed in single or double quotes!)
How do you expect any piece of code to work when your BASIC syntax skills are as bad as they are?
 
What are you trying to do?

If you're trying to set $date, you must do the whole expression in php, i.e.


<?php $date=date("d m Y : H:i:s", time())?>";

Or, set it in your $message, i.e.

$message "Hello, you registered at " .
date("d m Y : H:i:s", time()) . ". Thank you";

and if u need the date format then
<?php
echo date("Y-m-d");
echo date("Y/m/d");
echo date("M d, Y");
echo date("F d, Y");
echo date("D M d, Y");
echo date("l F d, Y");
echo date("l F d, Y, h:i:s");
echo date("l F d, Y, h:i A");
?>
outputs are :
2011-05-17
2011/05/17
May 17, 2011
May 17, 2011
Tue May 17, 2011
Tuesday May 17, 2011
Tuesday May 17, 2011, 10:23:34
Tuesday May 17, 2011, 10:23 AM
 
Back
Top