-3

我有一个简单的脚本,只用 PHP 发送邮件:

mail( "$webmaster_email", "RSVP from WC Entry Form",
   "From: $email, \n Name: $firstname $lastname \n 
   Phone Number: $phone \n 
   Address: $postal \n );
header( "Location: $thankyou_page" );

但我越来越Parse error: syntax error, unexpected T_STRING

我不确定这是什么谷歌没有给我任何明确的答案

有人知道为什么会这样吗?

4

2 回答 2

3
mail( "$webmaster_email", "RSVP from WC Entry Form",
   "From: $email, \n Name: $firstname $lastname \n 
   Phone Number: $phone \n 
   Address: $postal \n ");
header( "Location: $thankyou_page" );

你只是忘记了'"'。

于 2012-08-10T08:40:42.323 回答
2

将代码更改为

mail( "$webmaster_email", "RSVP from WC Entry Form",
   "From: $email, \n Name: $firstname $lastname \n 
   Phone Number: $phone \n 
   Address: $postal \n ");
header( "Location: $thankyou_page" );
于 2012-08-10T08:40:46.633 回答