asp登陆问题,大神帮忙看看!
2017-01-02 08:08
411 查看
我设置了3中登录方式,分别是用注册用户,QQ,邮箱登录,用注册用户跟QQ能成功登陆,但是一用邮箱登录就失败,请教各位大神帮忙看看。一登录就失败,就跳到这里。
以下是登录页面代码:
<!--#include file="Inc.asp"-->
<!--#include file="Inc/Md5.asp"-->
<%
BBS.Head"login.asp","","论坛登陆"
Dim Action
Action=Lcase(Request.querystring("action"))
If len(Action)>10 Then BBS.GotoErr(1)
Select Case Action
Case"exit"
If Request.ServerVariables("request_method") <> "POST" then
Response.write "<form name='KK' method=post action=?"&Request.ServerVariables("Query_String")&"></form><SCRIPT>if(confirm('您确定要退出论坛么?')){returnValue=KK.submit()}else{returnValue=history.back()}</SCRIPT>"
Response.End
End If
ExitLogin()
Case"login":CheckLogin()
Case else:Mian()
End select
BBS.Footer()
Set BBS =Nothing
Sub Mian()
Dim S
S=Request.ServerVariables("HTTP_REFERER")
If instr(lcase(S),"login.asp")>0 or instr(lcase(S),"err.asp")>0 then
Else
Session(CacheName&"BackURL")=S
End If
S="<form method=""post"" style=""margin:0px"" action=""login.asp?action=login"">"
S=S&BBS.Row("<b>请输入您的用户名:</b>","<input name=""name"" type=""text"" class=""submit"" size=""20"" /> <a href=""register.asp"">没有注册?</a>","65%","")
S=S&BBS.Row("<b>请输入您的密码:</b>","<input name=""Password"" type=""password"" size=""20"" /> <a href=""usersetup.asp?action=forgetpassword"">忘记密码?</a>","65%","")
If BBS.Info(14)="1" Then
S=S&BBS.Row("<b>请输入右边的验证码:</b>",BBS.GetiCode,"65%","")
Else
S=S&"<input name=""iCode"" type=""hidden"" value=""BBS"" />"
End If
S=S&BBS.Row("<b>Cookie 选项:</b>","<input type=radio name=""cookies"" value=""0"" checked class=checkbox />不保存 <input type=radio name=cookies value=""1"" class=checkbox />保存一天 <input type=radio name=cookies value=""30"" class=checkbox />保存一月","65%","")
S=S&BBS.Row("<b>选择登陆方式:</b>","<input type=radio value=""1"" checked name='hidden' class=checkbox />正常登陆 <input type='radio' value='2' name='hidden' class=checkbox />隐身登陆","65%","")
S=S&"<div style="" padding:5px;BACKGROUND: "&BBS.SkinsPIC(2)&";"" align=""center""><input Class='login' type=""submit"" value=""登 陆"" /></div></form>"
BBS.ShowTable"用户登陆",S
End Sub
Sub CheckLogin()
With BBS
Dim Rs,UserName,Password,IsHidden,CookiesDate,Content,iCode,S
.CheckMake
If .Info(10)<>"0" Then
If Session(CacheName&"LoginTime")+.Info(10)/1440>now() then .GotoErr(5)
End If
UserName=Request.Form("name")
Password=Request.Form("password")
IsHidden=Request.Form("hidden")
iCode=Request.Form("iCode")
CookiesDate=.CheckNum(Request.Form("cookies"))
If UserName="" or Password="" Then .GoToErr(6)
If .Info(14)="1" Then
If iCode<>Session("iCode") or Session("iCode")="" Then .GotoErr(8)
End If
If Not .Fun.Checkname(UserName) OR Not .Fun.CheckPassword(Password) then .GotoErr(16)
If .SafeBuckler(UserName,.MyIP,0) Then .Alert"BBS安全盾已启动!\n\n对不起,你尝试登陆错误超过3次,今天不能再登陆论坛。\n你的信息已被系统记录!","Index.asp"
Password=MD5(Password)
Set Rs = .Execute("select top 1 Id,Name,Password,Isdel,LastTime,QQ,Mail From [User] where name='"&UserName&"' or Mail='"&UserName&"' or QQ='"&UserName&"' and password='"&Password&"' and (Isdel=0 or Isdel=2)")
If Rs.Eof then
.SafeBuckler UserName,.MyIP,1
.GotoErr(9)
ElseIf Rs(3)=2 Then
.GotoErr(78)
Else
.LetMemor "","MyID",Rs(0)
.LetMemor "","MyName",Rs(1)
.LetMemor "","MyPassword",Password
.LetMemor "","MyHidden",IsHidden
.LetMemor "","CookiesDate",CookiesDate
.LetMemor "","LastTime",Rs(4)
Session(CacheName & "login")="1"
If Int(CookiesDate)>0 Then Response.Cookies(CacheName).Expires=date+Int(CookiesDate)
.Execute("update [user] set LastTime='"&.NowBbsTime&"',LastIp='"&.MyIp&"' where ID="&Rs(0))
Session(CacheName&"LoginTime")=now()
S=Session(CacheName&"BackURL")
If S="" Then S="Index.asp"
Content="<meta http-equiv=refresh content=2;url=Index.asp><div style='margin: 15px;line-height: 150%'><li><b>3</b> 秒钟后将自动返回首页</li><li><a href='Index.asp'>立即进入论坛首页</a></li><li><a href="&S&">返回刚才浏览的页面</a><br></div>"
End if
Rs.Close
Set Rs=Nothing
.ShowTable"登陆成功",Content
End With
End Sub
Sub ExitLogin()
BBS.SetMemorEmpty()
BBS.ShowTable "退出论坛","<div style='margin: 15px;line-height: 150%'><li>已经成功的退出论坛</li><li><a href='login.asp'>重新登陆</a></li><li><a href='Index.asp'>进入论坛首页</a></li></div>"
End Sub
%>
以下是登录页面代码:
<!--#include file="Inc.asp"-->
<!--#include file="Inc/Md5.asp"-->
<%
BBS.Head"login.asp","","论坛登陆"
Dim Action
Action=Lcase(Request.querystring("action"))
If len(Action)>10 Then BBS.GotoErr(1)
Select Case Action
Case"exit"
If Request.ServerVariables("request_method") <> "POST" then
Response.write "<form name='KK' method=post action=?"&Request.ServerVariables("Query_String")&"></form><SCRIPT>if(confirm('您确定要退出论坛么?')){returnValue=KK.submit()}else{returnValue=history.back()}</SCRIPT>"
Response.End
End If
ExitLogin()
Case"login":CheckLogin()
Case else:Mian()
End select
BBS.Footer()
Set BBS =Nothing
Sub Mian()
Dim S
S=Request.ServerVariables("HTTP_REFERER")
If instr(lcase(S),"login.asp")>0 or instr(lcase(S),"err.asp")>0 then
Else
Session(CacheName&"BackURL")=S
End If
S="<form method=""post"" style=""margin:0px"" action=""login.asp?action=login"">"
S=S&BBS.Row("<b>请输入您的用户名:</b>","<input name=""name"" type=""text"" class=""submit"" size=""20"" /> <a href=""register.asp"">没有注册?</a>","65%","")
S=S&BBS.Row("<b>请输入您的密码:</b>","<input name=""Password"" type=""password"" size=""20"" /> <a href=""usersetup.asp?action=forgetpassword"">忘记密码?</a>","65%","")
If BBS.Info(14)="1" Then
S=S&BBS.Row("<b>请输入右边的验证码:</b>",BBS.GetiCode,"65%","")
Else
S=S&"<input name=""iCode"" type=""hidden"" value=""BBS"" />"
End If
S=S&BBS.Row("<b>Cookie 选项:</b>","<input type=radio name=""cookies"" value=""0"" checked class=checkbox />不保存 <input type=radio name=cookies value=""1"" class=checkbox />保存一天 <input type=radio name=cookies value=""30"" class=checkbox />保存一月","65%","")
S=S&BBS.Row("<b>选择登陆方式:</b>","<input type=radio value=""1"" checked name='hidden' class=checkbox />正常登陆 <input type='radio' value='2' name='hidden' class=checkbox />隐身登陆","65%","")
S=S&"<div style="" padding:5px;BACKGROUND: "&BBS.SkinsPIC(2)&";"" align=""center""><input Class='login' type=""submit"" value=""登 陆"" /></div></form>"
BBS.ShowTable"用户登陆",S
End Sub
Sub CheckLogin()
With BBS
Dim Rs,UserName,Password,IsHidden,CookiesDate,Content,iCode,S
.CheckMake
If .Info(10)<>"0" Then
If Session(CacheName&"LoginTime")+.Info(10)/1440>now() then .GotoErr(5)
End If
UserName=Request.Form("name")
Password=Request.Form("password")
IsHidden=Request.Form("hidden")
iCode=Request.Form("iCode")
CookiesDate=.CheckNum(Request.Form("cookies"))
If UserName="" or Password="" Then .GoToErr(6)
If .Info(14)="1" Then
If iCode<>Session("iCode") or Session("iCode")="" Then .GotoErr(8)
End If
If Not .Fun.Checkname(UserName) OR Not .Fun.CheckPassword(Password) then .GotoErr(16)
If .SafeBuckler(UserName,.MyIP,0) Then .Alert"BBS安全盾已启动!\n\n对不起,你尝试登陆错误超过3次,今天不能再登陆论坛。\n你的信息已被系统记录!","Index.asp"
Password=MD5(Password)
Set Rs = .Execute("select top 1 Id,Name,Password,Isdel,LastTime,QQ,Mail From [User] where name='"&UserName&"' or Mail='"&UserName&"' or QQ='"&UserName&"' and password='"&Password&"' and (Isdel=0 or Isdel=2)")
If Rs.Eof then
.SafeBuckler UserName,.MyIP,1
.GotoErr(9)
ElseIf Rs(3)=2 Then
.GotoErr(78)
Else
.LetMemor "","MyID",Rs(0)
.LetMemor "","MyName",Rs(1)
.LetMemor "","MyPassword",Password
.LetMemor "","MyHidden",IsHidden
.LetMemor "","CookiesDate",CookiesDate
.LetMemor "","LastTime",Rs(4)
Session(CacheName & "login")="1"
If Int(CookiesDate)>0 Then Response.Cookies(CacheName).Expires=date+Int(CookiesDate)
.Execute("update [user] set LastTime='"&.NowBbsTime&"',LastIp='"&.MyIp&"' where ID="&Rs(0))
Session(CacheName&"LoginTime")=now()
S=Session(CacheName&"BackURL")
If S="" Then S="Index.asp"
Content="<meta http-equiv=refresh content=2;url=Index.asp><div style='margin: 15px;line-height: 150%'><li><b>3</b> 秒钟后将自动返回首页</li><li><a href='Index.asp'>立即进入论坛首页</a></li><li><a href="&S&">返回刚才浏览的页面</a><br></div>"
End if
Rs.Close
Set Rs=Nothing
.ShowTable"登陆成功",Content
End With
End Sub
Sub ExitLogin()
BBS.SetMemorEmpty()
BBS.ShowTable "退出论坛","<div style='margin: 15px;line-height: 150%'><li>已经成功的退出论坛</li><li><a href='login.asp'>重新登陆</a></li><li><a href='Index.asp'>进入论坛首页</a></li></div>"
End Sub
%>
相关文章推荐
- js调用asp时出现的郁闷问题,大家帮忙看看
- ASP登陆验证页应做的安全问题!
- 新手问题,大家帮忙看看..谁有意见散分给谁哦!
- 有关ASP.NET如果获取登陆用户信息问题
- asp.net优化问题,请各位帮忙。
- ASP.NET的MEMBERSHIP问题:你在用WEBPART, 登陆控件的时候,可能会发生的数据库连接错误。
- asp.net Forums2.0修改密码后无法登陆问题——都是Cache惹的祸
- [VB.NET]关于DataGridView的问题,会的请进来看看,帮忙解决!!
- ASP.NET 2.0关于用户登录限制问题实例:防止同一用户同时登陆
- ASP.NET Ajax 和ASP.NET 2.0 的登陆控件相冲突的问题的讨论
- asp发文系统的单引号、双引号问题~请大家帮忙
- 是登陆后CHECK.ASP问题已解决掉
- [ASP技术]asp防止同时登陆的问题
- 累加会员登陆时间问题,望高手帮忙谢谢!(急!)
- 一个ASP.NET2.0的问题,实在无法解决,请大家帮忙看看(放在首页一天后撤下,请DUDU原谅)问题已经解~~^_^
- 关于"博客园"管理员登陆中校验码不会变动问题(请dudu看看)
- asp登陆问题
- 安装软件时出了个怪问题,我截了个图。大家帮忙看看
- 关于不能登陆论坛的问题(自己解决拉)碰到同样问题的来看看
- ASP防止同时登陆的问题