大家帮我看看这段ASP后台检测登录的代码,我不知道哪出问题,后台访问不了,急呀!

来源:百度知道 编辑:UC知道 时间:2024/05/22 14:06:58
<!--#include file="conn.asp"-->
<!--#include file="../md5.asp"-->
<%dim admin,password,verifycode
admin=replace(trim(request("admin")),"'","")
password=md5(replace(trim(request("password")),"'",""))
verifycode=replace(trim(request("verifycode")),"'","")
if admin="" or password="" then
response.Write "<script LANGUAGE='javascript'>alert('您的管理ID或密码有误!');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")
rs.Open "select * f

ASP没有什么难的,只要你细心,仔细检查一下你的登录前台获取的几个数据是不是跟后台一样
÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷
password=md5(replace(trim(request("password")),"'",""))
先取出来,在MD5加密。
rs.Open "select * from shop_admin where admin='"&admin&"'" ,conn,1,1
if not rs.bof and not rs.eof then
if password=rs("password") then
下面该干吗自己写
。。。。。。。。。。。。
÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷
rs.Open "select * from shop_admin where admin='"&admin&"' and password='"&password&"' " ,conn,1,3

是不安全代码,分开验证更好。也不确定是不是对的,这里验证了,下面别再重复验证,先验证用户名再验证密码。你这个不见得能躲过SQL的与或绕过口令验证
如果对了,给我银子哦。。。。