注册 登录
编程论坛 ASP技术论坛

验证码错误

nyjie1782015 发布于 2015-06-23 22:26, 1885 次点击
哪位帮我看看!帐号和密码都是对的,为什么老是提交信息登录总显示验证码错误!

<!--#include file="conn.asp"-->
<%
code=trim(request.form("code"))
getcode=trim(session("code"))
adminName=request.Form("adminName")
adminPass=(replace(trim(request.form("adminPass")),"'",""))
if adminName="" then
response.Write"<script language='javascript'>alert('用户名不能为空!');history.go(-1);</script>"
response.end
end if
if request.Form("adminPass")="" then
response.Write"<script language='javascript'>alert('密码不能为空!');history.go(-1);</script>"
response.end
end if
if code="" then
response.write"<script>alert('验证码不能为空!');location.href='javascript:history.go(-1)';</script>"
response.end
end if
if code<>"" and not isnumeric(code) then
response.write"<script>alert('验证码必须为数字!');location.href='javascript:history.go(-1)';</script>"
response.end
end if
if code<>getcode then
response.write"<script>alert('验证码错误');location.href='javascript:history.go(-1)';</script>"
response.end
end if

set rs=server.CreateObject("adodb.recordset")
sql="select * from admin where adminName='"&adminName&"' and adminpass='"&adminpass&"'"
set rs=conn.execute(sql)
if rs.bof and rs.eof then
response.Write"<script language='javascript'>alert('用户或密码错误!');history.go(-1);</script>"
response.end
else
1 回复
#2
hu9jj2015-06-24 07:21
在调试时把输入的用户名、密码、验证码都显示出来,不就可以发现问题了么。
1