【发布时间】:2023-03-20 04:45:01
【问题描述】:
PHP 解析错误:语法错误,意外的 '=' 不确定最好的解决方法。尝试删除空格。为了隐私,我更改了我的电子邮件地址。
<?php
if(isset($_POST['submit'])) {
$msg = 'contact:'.$_POST['contact'] ."\n"
.'email:'.$_POST['email'] ."\n"
.'epk:'.$_POST['epk'] ."\n"
.'links:'.$_POST['links'] ."\n"
.'genre:'.$_POST['genre'] ."\n"
.'years:'.$_POST['years'] ."\n"
.'label:'.$_POST['label'] ."\n"
.'drop:'.$_POST['drop'] ."\n"
.'grant:'.$_POST['grant'] ."\n"
.'agree:'.$_POST['agree'] ."\n"
mail('name@mysite.com','EPK application',$msg);
header ('location:thanks.htm');
} else {
header ('location:application.htm') ;
exit(0);
}
?>
【问题讨论】:
-
您在该行的末尾缺少一个分号结尾,其中包含同意以完成 $msg 语句。