你能看到我出现意外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 :(得分:3)
你有一个;在if之后。只需删除它就可以了......;)
if($_POST['paypalemail'] != ''); //<-- Remove this ;
答案 1 :(得分:1)
请从
更改脚本if($_POST['paypalemail'] != '');
{
//An email was submitted.
}
到
if($_POST['paypalemail'] != '')
{
//An email was submitted.
}
您在if循环结束时输入了半冒号。请删除它。
答案 2 :(得分:1)
您必须删除第6行的;
,如下所示
if($_POST['paypalemail'] != '')
{
//An email was submitted.
}
答案 3 :(得分:0)
你的if
末尾有一个半冒号if($_POST['paypalemail'] != ''); <---