syntax error, unexpected T

Can you see any reason why I would be getting an unexpected T_ELSE error? I must be blind..

<?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>";
        }
} 
?>

You have a ; after the if. Just remove it and you will be fine... ;)

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

你在if的结尾处有一个分号

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

Please change the script from

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

to

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

You have entered semi colon at the end of if loop. Please remove it.

链接地址: http://www.djcxy.com/p/12018.html

上一篇: 解析错误:语法错误,意外的T

下一篇: 语法错误,意外的T