标题:验证码错误
只看楼主
nyjie1782015
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-6-23
结帖率:0
已结贴  问题点数:20 回复次数:1 
验证码错误
哪位帮我看看!帐号和密码都是对的,为什么老是提交信息登录总显示验证码错误!

<!--#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
搜索更多相关主题的帖子: javascript 验证码 replace include 用户名 
2015-06-23 22:26
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:396
帖 子:11713
专家分:43267
注 册:2006-5-13
得分:20 
在调试时把输入的用户名、密码、验证码都显示出来,不就可以发现问题了么。

活到老,学到老! http://www. E-mail:hu-jj@
2015-06-24 07:21



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-454669-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.589534 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved