asp如何通过用户名来进入不同的登陆界面
转换界面,修改??这是登陆界面<!--#includefile="conn.asp"--><!--#includefile="md5.asp"--><%name=requ...
转换界面,修改??
这是登陆界面
<!--#include file="conn.asp"--><!--#include file="md5.asp"--><%name=request.form("username")pwd=md5(trim(request("pwd")))if name<>"" and pwd<>"" thenset rs=server.CreateObject("ADODB.RecordSet")sql="select * from userinfo where name='"&name&"' and pwd='"&pwd&"'"on error resume nextrs.open sql,conn,1,3if rs.eof or rs.bof thenresponse.Write "<script language=javascript>alert('用户名或密码错
误!');history.go(-1);</script>"
response.End
elsers("logins")=rs("logins")+1rs("lastlogin")=now()rs("lastip")=Request.ServerVariables("REMOTE_ADDR")rs.updatesession.Timeout=2000session("userid")=rs("userid")session("name")=rs("name")session("oskey")=rs("oskey")session("depid")=rs("depid")session("logins")=rs("logins")rs.updaters.closeconn.closeset rs=nothingset conn=nothing
response.redirect "index.asp"
response.endend ifend if%> 展开
这是登陆界面
<!--#include file="conn.asp"--><!--#include file="md5.asp"--><%name=request.form("username")pwd=md5(trim(request("pwd")))if name<>"" and pwd<>"" thenset rs=server.CreateObject("ADODB.RecordSet")sql="select * from userinfo where name='"&name&"' and pwd='"&pwd&"'"on error resume nextrs.open sql,conn,1,3if rs.eof or rs.bof thenresponse.Write "<script language=javascript>alert('用户名或密码错
误!');history.go(-1);</script>"
response.End
elsers("logins")=rs("logins")+1rs("lastlogin")=now()rs("lastip")=Request.ServerVariables("REMOTE_ADDR")rs.updatesession.Timeout=2000session("userid")=rs("userid")session("name")=rs("name")session("oskey")=rs("oskey")session("depid")=rs("depid")session("logins")=rs("logins")rs.updaters.closeconn.closeset rs=nothingset conn=nothing
response.redirect "index.asp"
response.endend ifend if%> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询