WebfinityWorks Posted August 13, 2013 Share Posted August 13, 2013 Hello. I need help getting the date to submit in the email from this php form (http://www.cindys.com/awardreorder.php) I want the date to the be the first thing in the content of the email submitted. mail("[email protected],[email protected],[email protected]","Awards Re-Order","{$_POST[date('r')]}|{$_POST['yearaward']}|{$_POST['entrynumber']}|{$_POST['organization']} |{$_POST['productiontitle']} |{$_POST['categoryname']} |{$_POST['skill']} |{$_POST['season']} |{$_POST['entertainment']} |{$_POST['entertainment_other']} |{$_POST['membeshiptype']} |{$_POST['shiping_name']}|{$_POST['shipping_address']}|{$_POST['shipping_city']}|{$_POST['shipping_state']}|{$_POST['shipping_mailcode']}|{$_POST['shipping_country']}|{$_POST['shipping_email']}|{$_POST['shipping_telephone']}| {$_POST['shipping_fax']}|{$_POST['shipping_address']}","From:[email protected]\r\nReturn-Path:[email protected]"); What am I doing wrong? Clearly I am a beginner in PHP. Thanks for the help in advance! Link to comment https://forums.phpfreaks.com/topic/281110-help-with-date-in-php-email-code/ Share on other sites More sharing options...
PravinS Posted August 13, 2013 Share Posted August 13, 2013 just use PHP date() function refer: http://php.net/manual/en/function.date.php Link to comment https://forums.phpfreaks.com/topic/281110-help-with-date-in-php-email-code/#findComment-1444696 Share on other sites More sharing options...
cyberRobot Posted August 13, 2013 Share Posted August 13, 2013 In addition to what PravinS said, the date() function needs to be outside of the quotes. <?php ..."Awards Re-Order", date('r') . "|{$_POST['yearaward']}|"... ?> Link to comment https://forums.phpfreaks.com/topic/281110-help-with-date-in-php-email-code/#findComment-1444753 Share on other sites More sharing options...
WebfinityWorks Posted August 14, 2013 Author Share Posted August 14, 2013 Okay cyber robot.. I can remove it from the quotes but will that keep it in message portion of the email? Link to comment https://forums.phpfreaks.com/topic/281110-help-with-date-in-php-email-code/#findComment-1444919 Share on other sites More sharing options...
WebfinityWorks Posted August 14, 2013 Author Share Posted August 14, 2013 I need the date to be the very first item that is read in the email message. As you can tell, I know very little about php. I've spent a lot of time reading over the site you suggested previous to posting. At this point, I'm at a loss and in need of help from the phpfreaks experts. Link to comment https://forums.phpfreaks.com/topic/281110-help-with-date-in-php-email-code/#findComment-1444920 Share on other sites More sharing options...
cyberRobot Posted August 14, 2013 Share Posted August 14, 2013 Okay cyber robot.. I can remove it from the quotes but will that keep it in message portion of the email? As long as the date() function is part of the third argument for mail(), it should appear in the message. The best way to determine if it works is to give it a try. Note: you'll probably want to send any tests to yourself instead of the people who typically receive the message. That way you can send out multiple messages without bothering other people. For future reference, I would recommend using variables to store the arguments for mail(). The code becomes much easier to follow. Examples 2 and 4 on the following page will show you what I mean: http://php.net/manual/en/function.mail.php Link to comment https://forums.phpfreaks.com/topic/281110-help-with-date-in-php-email-code/#findComment-1444972 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.