2017-12-23 14 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); 
} 


?> 
関連する問題