用户登录本地测试正常,但上传到服务器无法登陆
经检测是验证用户名那儿出问题了,不能与数据库验证,请大侠看看错误出哪儿了???<!-- #include file="BGMConn.asp" -->
<!-- #include file="LIB/md5.asp" -->
<%
dim username,userpwd,YzCode,sql,rs,Login
username=lcase(trim(request.Form("Username")))
userpwd=trim(request.Form("Password"))
YzCode=trim(request.Form("valication"))
if username="" then
response.write "<script>alert('登陆出错:\n\n用户名不能为空!');location.href='index.asp';</script>"
response.End()
end if
if userpwd="" then
response.write "<script>alert('登陆出错:\n\n密码不能为空!');location.href='index.asp';</script>"
response.End()
end if
if YzCode=""then
response.write "<script>alert('登陆出错:\n\n验证码不能为空!!');location.href='index.asp';</script>"
response.End()
end if
if cint(YzCode)<>cint(Session("GetCode")) then
response.write "<script>alert('登陆出错:\n\n验证码输入错误!!');location.href='index.asp';</script>"
response.End()
end if
sql="select * from namesfz where name='"&username&"'"
'sql="select * from namesfz"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
' Response.Write("llllllllllll")
Login=false
else
if rs("PassWord")=md5(userpwd) then
Login=true
session("AdminLogin")=true
session("name")=rs("name")
if rs("power")=1 then
session("AdminPower")="admin"
end if
if rs("power")=2 then
session("AdminPower")="1shen"
end if
if rs("power")=3 then
session("AdminPower")="2shen"
end if
if rs("power")=4 then
session("AdminPower")="chaxun"
end if
if rs("power")=5 then
session("AdminPower")="user"
end if
else
Login=false
end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
if Login=true then
if session("AdminPower")="admin" then
response.Redirect("admin.asp")
end if
if session("AdminPower")="1shen" then
response.Redirect("1shen.asp")
end if
if session("AdminPower")="2shen" then
response.Redirect("2shen.asp")
end if
if session("AdminPower")="chaxun" then
response.Redirect("chaxun.asp")
end if
if session("AdminPower")="user" then
response.Redirect("user.asp")
end if
else
response.write "<script>alert('登陆出错:\n\n用户名或密码错误 !');location.href='index.asp';</script>"
end if
%>