2012-10-12 170 views
0

你能看到任何我會得到意想不到的T_ELSE錯誤的原因嗎?我必須是盲人。語法錯誤,意外T_ELSE

<?php 
//Check if form was submitted 
if(isset($_POST['submit'])) 
{ 
    //Form was submitted. 
    if($_POST['paypalemail'] != ''); 
    { 
     //An email was submitted. 
    } 
    else 
     { 
      //There was nothing in the field. Tell them. 
      echo "<script language=\"javascript\">alert('The field was left empty. Please insert your PayPal email address and try again.');</script>"; 
     } 
} 
?> 
+0

嘗試刪除 「;」 on'if($ _ POST ['paypalemail']!='');' – user1732887

回答

3

你有一個;之後如果。只是刪除它,你將被罰款...;)

if($_POST['paypalemail'] != ''); //<-- Remove this ; 
+1

我必須失明!謝謝。 – KriiV

0

你必須在你的,如果

if($_POST['paypalemail'] != ''); <--- 
0

請從改變腳本結束分號

if($_POST['paypalemail'] != ''); 
{ 
    //An email was submitted. 
} 

if($_POST['paypalemail'] != '') 
{ 
    //An email was submitted. 
} 

您輸入了分號在循環結束時。請刪除它。

0

你要刪除第6行的;像下面

if($_POST['paypalemail'] != '') 
    { 
     //An email was submitted. 
    }