| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 713 人关注过本帖
标题:[求助}asp论坛增加uid登陆
取消只看楼主 加入收藏
thbwn
Rank: 1
等 级:新手上路
帖 子:235
专家分:0
注 册:2007-10-2
结帖率:80%
收藏
 问题点数:0 回复次数:0 
[求助}asp论坛增加uid登陆
以下是代码:
Sub Mian()
Dim S
S=Request.ServerVariables("HTTP_REFERER")
If instr(lcase(S),"login.asp")>0 or instr(lcase(S),"error.asp")>0 then
Else
Session(CacheName&"BackURL")=S
End If
S="<form method=""post"" style=""margin:0px"" action=""login.asp?action=login"">"
S=S&BBS94KK.Row("<b>请输入您的用户名:</b>","<input name=""name"" type=""text"" class=""submit"" size=""20"" /> <a href=""Register.asp"">没有注册?</a>","65%","")
S=S&BBS94KK.Row("<b>请输入您的密码:</b>","<input name=""Password"" type=""password"" size=""20"" /> <a href=""UserSetup.asp?Action=ForgetPassword"">忘记密码?</a>","65%","")
If BBS94KK.Info(14)="1" Then
    S=S&BBS94KK.Row("<b>请输入右边的验证码:</b>",BBS94KK.GetSafeCode,"65%","")
Else
    S=S&"<input name=""safecode"" type=""hidden"" value=""94kk"" />"
End If
S=S&BBS94KK.Row("<b>Cookie 选项:</b>","<input type=radio  name=""cookies"" value=""0"" checked />不保存<br /><input type=radio  name=cookies value=""1"" />保存一天<br /><input type=radio  name=cookies value=""30"" />保存一月<br /><input type=radio  name=cookies value=""365"" />保存一年","65%","")
S=S&BBS94KK.Row("<b>选择登陆方式:</b>","<input type=radio value=""1"" checked name='hidden' />正常登陆<br /><input type='radio' value='2' name='hidden' />隐身登陆","65%","")
S=S&"<div style="" padding:5px;BACKGROUND: "&BBS94KK.SkinsPIC(2)&";"" align=""center""><input Class='login' type=""submit"" value="" 登  陆 "" /></div></form>"
BBS94KK.ShowTable"用户登陆",S
End Sub

Sub CheckLogin()
    With BBS94KK
    Dim Rs,UserName,Password,IsHidden,CookiesDate,Content,SafeCode,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")
    SafeCode=Request.Form("safecode")
    CookiesDate=.CheckNum(Request.Form("cookies"))
    If UserName="" or Password="" Then .GoToErr(6)
    If .Info(14)="1" Then
        If SafeCode<>Session("Safecode") or Session("SafeCode")="" 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"94KKBBS安全盾已启动!\n\n对不起,你尝试登陆错误超过3次,今天不能再登陆论坛。\n你的信息已被系统记录!","Index.asp"
    Password=MD5(Password)
    Set Rs = .Execute("select top 1 Id,Name,Password,Isdel,LastTime From [KK_User] where name='"&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)
        If Int(CookiesDate)>0 Then    Response.Cookies(CacheName).Expires=date+Int(CookiesDate)
        .Execute("update [KK_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
    Session(CacheName&"BackURL")=""
    .ShowTable"登陆成功",Content
    End With
End Sub
搜索更多相关主题的帖子: uid asp login 
2008-03-10 20:37
快速回复:[求助}asp论坛增加uid登陆
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.046916 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved