2012-07-25 220 views
1

所以我有一个脚本来检查登录细节..我有这个工作,但我想进一步开发这个更具体的信息。PHP登录身份验证

会有2个错误;不正确的密码/用户名或账户没有激活

我有这样的代码,但我得到了以下错误:“解析错误:语法错误,意外T_ELSE”

} else if ($active=="no"); { 
header("Location: ../index.php?NotActived"); 
exit(); 
} 

else { 
    header("location: ../index.php?Badpass"); 
    exit(); 

} 

我有一个if stament顶部我的脚本创建会话,如果用户的详细信息是正确的。我知道我可以在阿贾克斯/ jQuery的做到这一点,但我还挺新到和这个小项目,我想坚持到PHP

回答

3
} else if ($active=="no"); { 

您需要删除分号:

} else if ($active=="no") { 
+0

GRR,小白错误-.-欢呼:d – Rsmithy 2012-07-25 17:57:43

1
} else if ($active=="no"); { 

应该

} else if ($active=="no") { 
+0

GRR,小白错误-.-欢呼:d – Rsmithy 2012-07-25 17:57:09