[英]need help regarding $_POST in PHP
我的一段代碼有問題,請讓我知道我哪里出錯了。 我正在向我的帳戶發送電子郵件,但收到的錯誤是...我僅獲得一半的信息。
為了清楚了解我要問的內容,請附上以下代碼。
<?php
$first_name = $_POST["name_t"] ;
$last_name = $_POST["lname_t"] ;
$contact=$_POST["contact"] ;
$email = $_POST["email"] ;
$adults =$_POST["no_adults_t"] ;
$children = $_POST["no_children"] ;
$address = $_POST["address"] ;
$date = $_POST["date_t"] ;
$message = "First Name : ".$first_name."\n\nLast Name : ".$last_name."\n\nContact Number : ".$contact."\n\nAddress :".$address."\n\nE mail :".$email."\n\n Number Of Adults : ".$adults."\n\nNumber Of children : ".$children."\n\nReservation Date : ".$date;
$headers = "From:" . $email;
@mail( "someone@someone.com", "some subject ",$message,$headers);
echo "<pre>".print_r($_REQUEST, 1)."</pre>";
print $first_name;
print $last_name;
print $contact;
print $email;
print $adults;
print $children;
print $address;
print $date;
print "<body style="."background-color:gray"."></body>
<h2 style="."color:maroon;".">Thank You.Your information has been submitted.Our Representative would be contacting you shortly</h2>
<h4 style="."color:blue"."><a href="."index.html".">Click Here To Go Back to Main Page.</a></h4>"
?>
嘗試使用SMTP發送(http://phpmailer.worxware.com/)
請參閱此鏈接:-http: //www.w3schools.com/php/php_mail.asp ,也請首先使用此“ var_dump($ _ POST);” 並檢查您是否正在獲取所有值。 我認為電子郵件功能不適用於localhost。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.