0

您能看出我会收到意外 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>";
        }
} 
?>
4

4 回答 4

3

你有一个 ; 如果之后。只需删除它,你会没事的......;)

if($_POST['paypalemail'] != ''); //<-- Remove this ;
于 2012-10-12T10:05:25.697 回答
1

您必须删除第;6 行,如下所示

if($_POST['paypalemail'] != '')
    {
        //An email was submitted.
    } 
于 2012-10-12T10:07:19.610 回答
1

请更改脚本

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

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

您在 if 循环的末尾输入了分号。请删除它。

于 2012-10-12T10:06:06.273 回答
0

你的 if 结尾有一个分号

if($_POST['paypalemail'] != ''); <---
于 2012-10-12T10:05:57.740 回答