2017-12-23 3 views
-1

PHP 구문 분석 오류 : 예기치 않은 '=' 가장 좋은 해결 방법은 확실하지 않습니다. 공백을 제거하려고했습니다. 개인 정보 보호를 위해 이메일 주소를 변경했습니다.PHP : '구문 오류, 예기치 않은 T_STRING'

<?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

$ msg 문을 완료하는 데 동의하는 행의 세미콜론 끝이 누락되었습니다. –

답변

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


?>