我写了这个PHP脚本,通过电子邮件检索我的表单结果。一切都很好,但我不知道如何添加结果的时间和日期戳。这是我目前的代码:
<?php
$name = $_REQUEST['name'] ;
$carenumber= $_REQUEST['carenumber'] ;
$email = $_REQUEST['email'] ;
$topic = $_REQUEST['topic'] ;
$message = $_REQUEST['message'] ;
$Body = "";
$Body .= "Name: ";
$Body .= $name;
$Body .= "\n";
$Body .= "\n";
$Body .= "Caregiver Number: ";
$Body .= $carenumber;
$Body .= "\n";
$Body .= "\n";
$Body .= "Email Address: ";
$Body .= $email;
$Body .= "\n";
$Body .= "\n";
$Body .= "Topic: ";
$Body .= $topic;
$Body .= "\n";
$Body .= "\n";
$Body .= "Message: ";
$Body .= $message;
$Body .= "\n";
mail( "eriksnet@mac.com", "Message From Myorphan.com Contact Page",
$Body, "From: $email" );
header( "Location: http://www.feedmyorphan.com/contact_confirm.htm" );
?>
答案 0 :(得分:0)
你应该添加:
$Body .= "Sent Date: ";
$Body .= date("F j, Y, g:i a"); // October 22, 2010, 5:16 pm