2015-06-22 74 views
-1

試圖獲得表格結果通過電子郵件發送給我們,並讓客戶得到一個謝謝
電子郵件發佈請求在我們的網站上。 這是一個非常漫長的3天不停的,不是程序員,而是一直在閱讀和學習。不斷收到「解析錯誤,語法錯誤」,3天不間斷,艱難

繼續收到「語法錯誤或行結束時出現意外錯誤。」 在線驗證器中獲得了所有代碼,並且還顯示
行結尾處出現意外和語法錯誤。」
非常感謝。

<html> 
<?php 

if($_POST["submit"]) { 

$webmaster="[email protected]"; 
$subject="Limousines Quote Request"; 
$subject_client="Thank you for your Request"; 

$headers = 'From: LimousinesWorld' . "\r\n" . 
'Reply-To: [email protected]' . "\r\n" . 
$headers = 'MIME-Version: 1.0' . "\r\n"; 
$headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 'X- 
Mailer: PHP/'; 
$headers[] = "From: LimousinesWorld <[email protected]>";  

$replyemail="[email protected]"; 

$senderClient=$_POST['EMail']; 

$Comments1 = $_REQUEST['Comments1'] ; 
$Comments2 = $_REQUEST['Comments2'] ; 
$Name = $_REQUEST['Name'] ; 
$Company = $_REQUEST['Company'] ; 
$Telephone = $_REQUEST['Telephone'] ; 
$EMail = $_REQUEST['EMail'] ; 
$When_need_limo = $_REQUEST['When_need_limo'] ; 


$mailBody= " 
    Comments1:   $Comments1 \n 
    Comments2:   $Comments2 \n 
    Name:    $Name \n 
    Company:   $Company \n 
    Telephone:   $Telephone \n 
    EMail:    $EMail \n 
    When_need_limo:  $When_need_limo \n; 

$mailBody_client= ' 
<html> 
</head> 
<body> 
<p>&nbsp;</p> 

<p><b>Thank you for your Limousine Quote Request on our website. 

<p><b>We will get back to you with very soon with: Prices, Pictures,  
Equipment and Options.</b></p> 

<p><b>Best regards,<br /> 
<br /> 
LimousinesWorld<br /> 

<p>&nbsp;</p> 
</body> 
</html> 
'; 


mail($webmaster, $subject, $mailBody, $headers); 

mail($senderClient, $subject_client, $mailBody_client, $headers); 

} 
?> 



</html> 
+0

您在這裏失蹤兩件事情: 1. $ mailBody結束就像@Gerton沒有添加另一個雙引號。 2.最後{應該在關閉php標籤之前,而不是之後。 –

回答

1

開關

$mailBody= " 
    Comments1:   $Comments1 \n 
    Comments2:   $Comments2 \n 
    Name:    $Name \n 
    Company:   $Company \n 
    Telephone:   $Telephone \n 
    EMail:    $EMail \n 
    When_need_limo:  $When_need_limo \n; 

;

$mailBody= " 
    Comments1:   $Comments1 \n 
    Comments2:   $Comments2 \n 
    Name:    $Name \n 
    Company:   $Company \n 
    Telephone:   $Telephone \n 
    EMail:    $EMail \n 
    When_need_limo:  $When_need_limo \n"; 

應該工作

0

前再添"在年底更換

$mailBody= " 
    Comments1:   $Comments1 \n 
    Comments2:   $Comments2 \n 
    Name:    $Name \n 
    Company:   $Company \n 
    Telephone:   $Telephone \n 
    EMail:    $EMail \n 
    When_need_limo:  $When_need_limo \n; 

$mailBody_client= ' 
<html> 
</head> 
<body> 
<p>&nbsp;</p> 

<p><b>Thank you for your Limousine Quote Request on our website. 

<p><b>We will get back to you with very soon with: Prices, Pictures,  
Equipment and Options.</b></p> 

<p><b>Best regards,<br /> 
<br /> 
LimousinesWorld<br /> 

<p>&nbsp;</p> 
</body> 
</html> 
'; 


mail($webmaster, $subject, $mailBody, $headers); 

mail($senderClient, $subject_client, $mailBody_client, $headers); 


?> 
} 


</html> 

有了:

$mailBody= " 
    Comments1:   $Comments1 \n 
    Comments2:   $Comments2 \n 
    Name:    $Name \n 
    Company:   $Company \n 
    Telephone:   $Telephone \n 
    EMail:    $EMail \n 
    When_need_limo:  $When_need_limo \n"; 

$mailBody_client= ' 
<html> 
</head> 
<body> 
<p>&nbsp;</p> 

<p><b>Thank you for your Limousine Quote Request on our website. 

<p><b>We will get back to you with very soon with: Prices, Pictures,  
Equipment and Options.</b></p> 

<p><b>Best regards,<br /> 
<br /> 
LimousinesWorld<br /> 

<p>&nbsp;</p> 
</body> 
</html> 
'; 


mail($webmaster, $subject, $mailBody, $headers); 

mail($senderClient, $subject_client, $mailBody_client, $headers); 


?> 
} 


</html> 
+0

非常感謝很多傢伙,在50秒內你發現我不能在... 3天:-) 你搖滾,謝謝。 – Ced

+0

歡迎您接受並投票回答。謝謝!! – Iffi

相關問題