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?"
 
This page from the PHP manual will explain everything you need to know about how to format the date properly: http://php.net/manual/en/function.date.php

Do you know that the DATE function uses your servers timezone settings? This means your date could be wrong compared to your actual location. If that is an issue look into the gmdate function here:
http://www.php.net/manual/en/function.gmdate.php

Your code seems right though for the date, it should be working. Go back and add quotes around your POST though.

You have this -> $_POST[check]

It should be this -> $_POST['check'] OR $_POST["check"] (First one is the proper way)
 
Back
Top