2013-07-19 38 views
-2

我收到一個語法錯誤,意外的T_SL在EOD。從我一直在閱讀它通常是從額外的空間/標籤/空白空間。在這種情況下,沒有。我甚至硬編碼了電子郵件,仍然收到錯誤。我已經嘗試將EOD的末尾放在另一個沒有空格的行上,但仍然不起作用。任何其他想法?解析錯誤:語法錯誤,意外T_SL

$emailSubject = 'crazy php scripting!'; 
$webMaster = '[email protected]'; 
$email = '[email protected]'; 
/* This is the line i get errors from. */ 
$body = <<<EOD<br><hr><br>Email:{$email}<br>EOD; 
$headers = "From: $email\r\n"; 
$headers .= "Content-type: text/html\r\n"; 
$success = mail($webMaster, $emailSubject, $body, $headers); 

回答

6

改變這一行

$body = <<<EOD<br><hr><br>Email:{$email}<br>EOD; 

到:

$body = <<<EOD 
<br><hr><br>Email:{$email}<br> 
EOD; 

因爲heredocs符號應該是在新的行首

相關問題