PHP:'语法错误,意外的T_STRING'

时间:2017-12-23 02:10:18

标签: php formmail

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

source

1 个答案:

答案 0 :(得分:-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);  
 }


?>