📄 login.asp
字号:
<!--#include file="inc.asp"-->
<!--#include file="inc/md5.asp"-->
<%Dim Action,Caption,Content
Call BBS94KK.Head("论坛登陆")
Action=Lcase(Request.querystring("action"))
Select Case Action
Case"exit"
ExitLogin()
Case"login"
CheckLogin()
Case else
Content=Replace(BBS94KK.Template.ReadTemplate("用户登陆"),"</form>","<input type='hidden' name='url' value='"&Request.ServerVariables("HTTP_REFERER")&"'></form>")
Response.Write(Content)
End select
BBS94KK.Footer()
Set BBS94KK=Nothing
Sub CheckLogin()
Dim Temp,TemUrl,Rs,UserName,Password,IsHidden,CookiesDate
BBS94KK.Fun.CheckMake
If BBS94KK.GetCookiesInfo("Login",0)=>5 Then BBS94KK.GotoErr(59)
If (Session(BBS94KK.CacheName&"lgtime")+BBS94KK.BbsCache(34)/1440)>now() then BBS94KK.GotoErr(15)
TemUrl=Replace(Request.Form("url"),"'","''")
if TemUrl="" then TemUrl=Request.ServerVariables("HTTP_REFERER")
UserName=Lcase(BBS94KK.Fun.GetStr("name"))
Password=BBS94KK.Fun.GetStr("password")
IsHidden=BBS94KK.Fun.GetStr("hidden")
CookiesDate=BBS94KK.CheckNum(Request.Form("cookies"))
If UserName="" or Password="" Then BBS94KK.GoToErr(3)
if Not BBS94KK.Fun.Checkname(UserName) or not BBS94KK.Fun.CheckPassword(Password) then BBS94KK.GotoErr(16)
Password=md5(Password)
Set Rs = BBS94KK.Execute("select top 1 Id From [KK_User] where Lcase(name)='"&UserName&"' and password='"&Password&"' and Isdel=False")
If Rs.Eof then
BBS94KK.GotoErr(16)
Else
Response.Cookies(BBS94KK.CookiesName)("MyID")=Rs(0)
Response.Cookies(BBS94KK.CookiesName)("MyName")=UserName
Response.Cookies(BBS94KK.CookiesName)("MyPwd")=Password
Response.Cookies(BBS94KK.CookiesName)("MyHidden")=IsHidden
Response.Cookies(BBS94KK.CookiesName)("CookiesDate")=CookiesDate
If CookiesDate=1 then
Response.Cookies(BBS94KK.CookiesName).Expires=date+1
Elseif CookiesDate=30 then
Response.Cookies(BBS94KK.CookiesName).Expires=date+30
Elseif CookiesDate=365 then
Response.Cookies(BBS94KK.CookiesName).Expires=date+365
Elseif CookiesDate=0 then
End if
BBS94KK.Execute("update [KK_user] set loginnum=loginnum+1,coin=coin+20,LastTime='"&BBS94KK.NowBbsTime&"',LastIp='"&BBS94KK.MyIp&"' where name='"&UserName&"'")
Dim MyID
If instr(LCase(TemUrl),"register.asp")>0 or Instr(LCase(TemUrl),"login.asp")>0 or instr(LCase(TemUrl),"error.asp")>0 or TemUrl="" then
TemUrl=""
Else
TemUrl="<li><a href="&TemUrl&">"&BBS94KK.Fun.HtmlCode(TemUrl)&"</a><br>"
End if
Session(BBS94KK.CacheName&"lgtime")=now()
Cache.Name="UserOnline"
Cache.Clean()
Call BBS94KK.UpdateCookiesInfo("Login",0)
Caption="登 陆 成 功"
Content="<meta http-equiv=refresh content=2;url=index.asp><div style='margin: 15;line-height: 150%'><li><b>3</b> 秒钟后将自动返回首页<li><a href='index.asp'>立即进入论坛首页</a>"&TemUrl&"</p>"
End if
Rs.Close
Call BBS94KK.ShowTable(Caption,Content)
End Sub
Sub ExitLogin()
BBS94KK.MakeCookiesEmpty()
Caption="退出论坛"
Content="<div style='margin: 15;line-height: 150%'><li>已经成功的退出论坛<li><a href=login.asp>重新登陆</a><li><a href=index.asp>进入论坛首页</a></div>"
Call BBS94KK.ShowTable(Caption,Content)
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -