-1

PHP Parse 错误:语法错误,意外 '=' 不确定最佳解决方法。尝试删除空格。为了隐私,我更改了我的电子邮件地址。

<?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);  
 }


?>
4

1 回答 1

-1

缺少一个分号。我发表评论以突出在评论中难以描述的位置:

<?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"; // <--- Semi-colon
  mail('name@mysite.com','EPK application',$msg);
  header ('location:thanks.htm');   
  } else {  
  header ('location:application.htm') ;
  exit(0);  
 }


?>
于 2017-12-23T02:14:52.707 回答