PHP: 'syntax error, unexpected T_STRING'

290 Views Asked by At

PHP Parse error: syntax error, unexpected '=' Not sure the best way to resolve. tried removing the spaces. I changed my email address for privacy.

<?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('[email protected]','EPK application',$msg);
  header ('location:thanks.htm');   
  } else {  
  header ('location:application.htm') ;
  exit(0);  
 }


?>
1

There are 1 best solutions below

0
On

There is a missing semi-colon. I put a comment to highlight the location which is hard to describe in a comment:

<?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('[email protected]','EPK application',$msg);
  header ('location:thanks.htm');   
  } else {  
  header ('location:application.htm') ;
  exit(0);  
 }


?>