怎么取消asp后台登陆验证码啊?
网站每用三四天,网站后台的验证码就无法显示,好像接着md5.asp也就消失了!怎么也上传不上去!想如何解决这个问题,或者如何不要验证码直接登录?<%dimrsdimuse...
网站每用三四天,网站后台的验证码就无法显示,好像接着md5.asp也就消失了!怎么也上传不上去!
想如何解决这个问题,或者如何不要验证码直接登录?
<%
dim rs
dim username
dim password
username=replace(trim(request("username")),"'","‘")
password=md5(replace(trim(request("password")),"'","‘"))
ip = Request.ServerVariables("HTTP_X_FORWARDED_FOR" )
If userip = "" Then
ip = Request.ServerVariables("REMOTE_ADDR" )
end if
if request("username")="" and request("password")="" then
userid="用户名密码为空"
elseif request("username")<>"" and request("password")="" then
userid=""&request("username")&"|密码为空"
elseif request("username")="" and request("password")<>"" then
userid="用户名为空|"&request("password")&""
else
userid=""&request("username")&"|"&request("password")&""
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [AK_count]"
rs.open sql,conn,1,3
rs.addnew
rs("user")=userid
rs("ip")=ip
rs("postdate")=now()
rs.update
rs.close
set rs=nothing
if session("fox_err")="" then
session("fox_err")=0
else
if session("fox_err")>=30 then '错误次数设置
response.write " <script LANGUAGE='javascript'>alert('你已经被锁定,请不要尝试非法登陆!');history.go(-1);</script>"
response.end
end if
end if
if trim(request("username"))="" or trim(request("password"))="" then
response.write "<script LANGUAGE='javascript'>alert('账号密码为空!');history.go(-1);</script>"
response.end
end if
if cstr(session("getcode"))<>cstr(trim(request("verifycode"))) then
response.Write "<script LANGUAGE='javascript'>alert('请输入正确的验证码!');history.go(-1);</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [AK_admin] where admin_pass='"&Password&"' and admin_name='"&UserName&"'"
rs.open sql,conn,1,1
if not rs.bof and not rs.eof then
if password=rs("admin_pass") and rs("admin_lock")=1 then
Response.cookies("foxwww")("administrator")=rs("admin_name")
Response.cookies("foxwww")("foxb")=rs("admin_foxb")
Response.cookies("foxwww")("fox")=rs("admin_flag")
session("admin_name")=rs("admin_name")
session("admin_shm")=rs("admin_shuoming")
session("admin_qu")=rs("admin_foxb")
session("admin_fox")=now()
Response.cookies("fox")("domain")=Request.ServerVariables("SERVER_NAME")
Response.Redirect "index.asp"
else
session("fox_err")=session("fox_err")+1
response.write "<script LANGUAGE='javascript'>alert('您的管理ID可能被锁定,请联系我们!');history.go(-1);</script> "
response.end
end if
else
session("fox_err")=session("fox_err")+1
response.write "<script LANGUAGE='javascript'>alert('身份确认失败,请重新登录!');history.go(-1);</script> "
response.end
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%> 展开
想如何解决这个问题,或者如何不要验证码直接登录?
<%
dim rs
dim username
dim password
username=replace(trim(request("username")),"'","‘")
password=md5(replace(trim(request("password")),"'","‘"))
ip = Request.ServerVariables("HTTP_X_FORWARDED_FOR" )
If userip = "" Then
ip = Request.ServerVariables("REMOTE_ADDR" )
end if
if request("username")="" and request("password")="" then
userid="用户名密码为空"
elseif request("username")<>"" and request("password")="" then
userid=""&request("username")&"|密码为空"
elseif request("username")="" and request("password")<>"" then
userid="用户名为空|"&request("password")&""
else
userid=""&request("username")&"|"&request("password")&""
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [AK_count]"
rs.open sql,conn,1,3
rs.addnew
rs("user")=userid
rs("ip")=ip
rs("postdate")=now()
rs.update
rs.close
set rs=nothing
if session("fox_err")="" then
session("fox_err")=0
else
if session("fox_err")>=30 then '错误次数设置
response.write " <script LANGUAGE='javascript'>alert('你已经被锁定,请不要尝试非法登陆!');history.go(-1);</script>"
response.end
end if
end if
if trim(request("username"))="" or trim(request("password"))="" then
response.write "<script LANGUAGE='javascript'>alert('账号密码为空!');history.go(-1);</script>"
response.end
end if
if cstr(session("getcode"))<>cstr(trim(request("verifycode"))) then
response.Write "<script LANGUAGE='javascript'>alert('请输入正确的验证码!');history.go(-1);</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [AK_admin] where admin_pass='"&Password&"' and admin_name='"&UserName&"'"
rs.open sql,conn,1,1
if not rs.bof and not rs.eof then
if password=rs("admin_pass") and rs("admin_lock")=1 then
Response.cookies("foxwww")("administrator")=rs("admin_name")
Response.cookies("foxwww")("foxb")=rs("admin_foxb")
Response.cookies("foxwww")("fox")=rs("admin_flag")
session("admin_name")=rs("admin_name")
session("admin_shm")=rs("admin_shuoming")
session("admin_qu")=rs("admin_foxb")
session("admin_fox")=now()
Response.cookies("fox")("domain")=Request.ServerVariables("SERVER_NAME")
Response.Redirect "index.asp"
else
session("fox_err")=session("fox_err")+1
response.write "<script LANGUAGE='javascript'>alert('您的管理ID可能被锁定,请联系我们!');history.go(-1);</script> "
response.end
end if
else
session("fox_err")=session("fox_err")+1
response.write "<script LANGUAGE='javascript'>alert('身份确认失败,请重新登录!');history.go(-1);</script> "
response.end
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询