用ASP做登陆,验证码错了也能登陆的问题??

来源:百度知道 编辑:UC知道 时间:2024/05/13 07:26:04
用LEFT.ASP和LEFT_USER.ASP文件做,但是就是输入错的验证码也没检验出来.请问要怎么办?
LEFT.ASP的代码:
<table cellpadding="0" cellspacing="0">
<form name="form1" method="post" action="default.asp">
<tr>
<td width="15" height="20" > </td>
<td height="20" colspan="2" align="center" bgcolor="#FFFFFF" ><FONT COLOR="#FF9966"><B>用户登陆 </B></FONT></td>
<td width="20" height="20" > </td>
</tr>
<tr>
<td height="25"> </td>
<td width="80">用户名:</td>
<td width="75"><input name="username" type="text" size="8"></td>
<td> </td>
</tr>
<tr>
<td h

你这压根都没验证!

在LEFT.ASP中的else if(form1.passcode.value=="")
{
window.alert("验证码不能为空!!");
return false;
form1.passcode.focus();
}
后面加上这段程序试试:
else
if passcode<>Session("GetCode") then
response.Write "<script LANGUAGE='javascript'>alert('登录失败!验证码错误!');history.go(-1);</script>"
rs.Close
set rs=nothing
conn.Close
set conn=nothing
response.end
end if

那把这段去掉试试:
else if(form1.passcode.value=="")
{
window.alert("验证码不能为空!!");
return false;
form1.passcode.focus();
}

相同的验证代码,即使一点也没有改动或者代码一模一样,也有可能不提示错误,我也碰到过多次,就是不知道有什么好的解决办法!!!!!!!!!!!!!!!
建议不要用编辑代码的形式,做这个提示错误.

这么难个问题不知道混2分不好意思!!!