<% '定义全局变量===================== 'if Replace(request.cookies(cookiesname)("username"), "'", "''")<>"" then 'response.redirect "../my" 'end if if request.cookies(cookiesname)("username")<>"" and request.cookies(cookiesname)("userpassword")<>"" then %> >进入网址管理中心 <% response.end end if dim action,comeurl,errcode,title username=request("username") action=request("action") errcode=request("errcode") if action="showlogin" then showlogin() response.end end if 'userid=replace(trim(request("username")), "'", "''") 'if title<>"" then 'headtitle=title 'end if '================================ %> <%=sitename%>网址管理中心 <% If Request("comeurl")<>"" Then Comeurl=Request("comeurl") ElseIf Request.ServerVariables("HTTP_REFERER")<>"" Then Comeurl=server.urlencode(Request.ServerVariables("HTTP_REFERER")) 'tmpstr=split(Request.ServerVariables("HTTP_REFERER"),"/") 'Comeurl=tmpstr(UBound(tmpstr)) Else Comeurl="../index.htm" End If '各类动作 if action="getpassword" then getpassword() elseif action="ok" then ok() elseif action="chklogin" then chklogin() elseif action="out" then out() else login() end if sub ok() '成功登录 response.write"
登录成功!

" if comeurl<>"" then if instr(comeurl,"login")=0 and instr(comeurl,"logout")=0 and instr(comeurl,"register")=0 then response.write"返回上一页
" end if end if response.write"首页
" response.write"我的网址收藏门户
" response.write"我的收藏管理中心
" end sub sub chklogin() dim rs dim sql dim userip,myusername,myuserpassword,myuserid password=replace(trim(Request("password")), "'", "''") password=md5(password) set rs=server.createobject("adodb.recordset") if o_db_flag=1 then sql="select "&o_username&","&o_password&","&o_userid&" from "&o_user_table&" where "&o_username&"='"&username&"'" rs.open sql,o_conn,1,3 myusername=rs(""&o_username&"") myuserpassword=rs(o_password) myuserid=rs(o_userid) else sql="select * from dv_user where username='"&username&"'" rs.open sql,conn,1,3 myusername=rs("username") myuserpassword=rs("userpassword") myuserid=rs("userid") end if if rs.eof then response.redirect "login.asp?errcode=|1|&username="&username end if if not (rs.bof and rs.eof) then if rs("userpassword")=password then 'id=rs("id") ' dim radpass 'radpass=makePassword(6) ' userip=Request.ServerVariables("REMOTE_ADDR") 'conn.Execute("update user set nos=nos+1, online=1,login='"&radpass&"' where id="&id) response.cookies(cookiesname)("username")=myusername response.cookies(cookiesname)("password")=myuserpassword response.cookies(cookiesname)("userid")=myuserid 'response.cookies("userip")=userip 'response.cookies("login")=radpass 'response.cookies("okerer")="yesok" 'application(""&userid&"")="yes" 'response.cookies("myter")="yes" response.cookies(cookiesname).expires=date()+365 else response.redirect "login.asp?errcode=|2|&username="&username end if end if rs.close set rs=nothing '将匿名收藏数据加入数据库 if request.Cookies(url_cookiesname)("urlcookiecounter")<>"" then dim i i=request.Cookies(url_cookiesname)("urlcookiecounter") urlcookiecounter=1 do while urlcookiecounter-i-1<0 url=request.cookies(url_cookiesname)("cookie_url_"&urlcookiecounter&"") urlname=request.cookies(url_cookiesname)("cookie_urlname_"&urlcookiecounter&"") set rs=server.createobject("adodb.recordset") sql="select url,urlname,username,userid,hide from detail_user where url='"&url&"' and urlname='"&urlname&"' and userid="&myuserid rs.open sql,conn,3,3 if rs.eof then rs.addnew rs("url")=url rs("urlname")=urlname rs("username")=myusername rs("userid")=myuserid rs("hide")=False rs.update end if urlcookiecounter=urlcookiecounter+1 'rs1.movenext loop response.Cookies(url_cookiesname)("urlcookiecounter")="" rs.close set rs=nothing end if '///////////////////////////////////////////////////////////////// conn.close set conn=nothing 'response.redirect Request.ServerVariables("HTTP_REFERER") response.redirect "login.asp?action=ok&comeurl="&comeurl end sub sub login() '登录界面 if instr(errcode,"|1|")<>0 then errstr="
出错:用户名错误,不接受!^_^ " end if if instr(errcode,"|2|")<>0 then errstr="
出错:密码错误,不接受!^_^ " end if if instr(errcode,"|3|")<>0 then errstr="
出错:Email错误,不接受!^_^ " end if %>
<%=errstr%>
你的用户名:


密码:
 忘记密码了 还没有注册

<% end sub sub getpassword() '取回密码 end sub sub out() response.cookies(cookiesname)("username")="" 'response.cookies("okerer")="" response.cookies(cookiesname)("userpassword")="" response.cookies(cookiesname)("userid")="" 'response.cookies(cookies_name).expires= response.redirect "login.asp" end sub sub showlogin() if request.cookies(cookiesname)("username")<>"" then 'response.write"document.write(""欢迎您,"&request.cookies(cookiesname)("username")&" 退出 收藏管理中心 我的网址收藏门户<\/a>"");" %> document.write("欢迎您,<%=request.cookies(cookiesname)("username")%><\/font> my\/login.asp?action=out\">退出<\/a> my\/\" target=_blank>收藏管理中心<\/a> hi\/?u=<%=userid%>\" target=_blank>我的网址收藏门户<\/a>"); <% else 'response.write"document.write(""注册 登录"");" %> document.write("网址收藏夹登陆:"); document.write("my\/register.asp\" target=\"_blank\">注册<\/a> my\/login.asp\" target=\"_blank\">登录<\/a>"); document.write("  hi/\" target=\"_blank\">临时网址收藏门户<\/a>"); <% end if 'response.write"document.write(""首页""); %> document.write("  \" target=\"_blank\">首页"); <% end sub %>