> 其他 >
else语句
是登录的判断过程,主要代码如下:
alert("用户名不能为空!");
window.location.href="login.jsp";
alert("请填写密码!");
window.location.href="login.jsp";
alert("用户名不存在!");
window.location.href="login.jsp";
alert("密码错误!请重新输入");
window.location.href="login.jsp";
alert("登录成功!下面转入首页");
window.location.href="main.jsp";
前面三个判断都是对的,但最后两个,无论密码输入正确与否,都显示“密码输入错误”,这是怎么回事?
人气:248 ℃ 时间:2020-06-18 20:02:06
解答
rs.getString(3)==password
改成rs.getString(3).equals(password)
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版