<!-- #include file="bbs/Inc.asp" -->
<!-- #include file="bbs/md5.asp" -->

<%

call head()
Dim urls,urlsid
urls=Request.Querystring("url")
If urls="" Then urls="index.asp"
If instr(urls,"@@")>0 or instr(urls,"?")>0 Then
urlsid="@@sid="
Else
urlsid="?sid="
End if
dim sid,TP,Action
sid=request("sid")
Action=request("Action")
if Action="ok" then

dim wapgo
wapgo=Request.QueryString("wapgo")
wapgo=replace(wapgo,"@@","&amp;")
wapgo=replace(wapgo,"bbo","bbsid")


dim user,pass,sql,kie
user=request("user")
pass=request("pass")
kie=request("kie")

if user="" or pass="" then
if saytk<>1 then
  Call Error("<title>出错</title></head><body><body bgcolor="""&yanse&"""><p>各项不能为空！")
else
  Call Error("<card title=""出错""><p>各项不能为空！")
  end if
end if
set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select * from Users where sjhm='"&user&"'",conn,1,1
if rs.eof then
rs.close
set rs=nothing

set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select * from Users where id="&user&"",conn,1,1
if rs.eof then
if saytk<>1 then
  Call Error("<title>出错</title></head><body><body bgcolor="""&yanse&"""><p>没有该会员注册信息！")
else
  Call Error("<card title=""出错""><p>没有该会员注册信息！")
  end if
end if
end if

if pass<>rs("mm") then
if saytk<>1 then
  Call Error("<title>出错</title></head><body><body bgcolor="""&yanse&"""><p>密码错误！")
else
  Call Error("<card title=""出错""><p>密码错误！")
  end if
end if
'-----------------写入cookies
response.cookies("TextCookies1")=""
response.cookies("TextCookies1").Path="/" '写入前先去掉缓存

if kie > 0 then

response.cookies("TextCookies1")=rs("sid")
response.cookies("TextCookies1").Path="/"
Response.Cookies("TextCookies1").Expires=#January 01, 2010#
end if
'-----------------写入cookies
Submitt=request("Submit")
If Submitt="安全登陆" Then

set rs2=Server.CreateObject("ADODB.Recordset")
rs2.open"select * from users where id="&user,conn,1,2
sjhm=rs2("sjhm")
rs2.close
set rs2=Nothing

Function SID_RANDOMIZE()
Dim c,id
randomize 
c="a,A,1,b,B,2,c,C,3,d,D,4,e,E,5,f,F,6,g,G,7,h,H,8,i,I,9,j,J,0,k,K,1,l,L,2,m,M,3,n,N,4,o,O,5,p,P,6,q,Q,7,r,R,8,s,S,9,t,T,0,u,v,w,x,y,z,"
id=split(c,",") 
for i=1 to 10
SID_RANDOMIZE=int(rnd()*36)&SID_RANDOMIZE
Next
SID_RANDOMIZE=SID_RANDOMIZE&minute(now)&second(now)&day(now)&month(now)
End Function
siddds=sjhm*SID_RANDOMIZE
set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select * from users where id="&user,conn,1,2
rs1("sid")=user&"_"&md5(md5(siddds,16),32)
rs1.Update
sida=rs1("sid")
rs1.close
set rs1=Nothing


Call cardz("社区登陆",""&replace(wapgo,"sayou=","saytk=")&""&sida&"")

Set rsd = Server.CreateObject("ADODB.Recordset")
sql="Select top 1 * from dongtai order by id desc"
rsd.open sql,conn,1,1 




conn.execute("insert into sqdt(shijian,dz)values('"&now&"','"&mz&""&rs("name")&"(ID:"&rs("id")&") 登陆了,有认识的朋友快去打个招呼!')")



response.write "<安全登陆模式>登录成功！<br/>"
response.write ""&waptitle&"欢迎您!!<br/>"
response.write "<a href='"&replace(wapgo,"sayou","saytk")&""&sida&"'>点击返回来源页</a>(6秒后自动返回)<br/>"


response.write "----------<br/>"
response.write "温馨提醒:<br/>"
response.write "书签地址中sid="&sida&"为您的身份标识码, 在做提取地址时要去掉标识,不要泄露给他人.请妥善保管!<br/>"
response.write "<a href=""/bbs/sid.asp?sid="&sida&"&amp;saytk="&saytk&""">重设登录标识</a>"
response.write "<br/>---------<br/><a href=""/bbs/show.asp?sid="&sida&"&amp;saytk="&saytk&""">我的空间</a>"
response.write "<br/><a href=""/bbs/index.asp?sid="&sida&"&amp;saytk="&saytk&""">社区首页</a>"
response.write "<br/><a href=""/index.asp?sid="&sida&"&amp;saytk="&saytk&""">网站首页</a>"
rs.close
set rs=nothing
conn.close
set conn=Nothing
Call head1()
response.End 

End If




Call cardz("社区登陆",""&replace(wapgo,"sayou","saytk")&""&rs("sid")&"")

Set rsd = Server.CreateObject("ADODB.Recordset")
sql="Select top 1 * from dongtai order by id desc"
rsd.open sql,conn,1,1 




conn.execute("insert into sqdt(shijian,dz)values('"&now&"','"&mz&""&rs("name")&"(ID:"&rs("id")&") 登陆了,有认识的朋友快去打个招呼!')")


If saytk=100 Then Response.write "<div class=""nav"">"
response.write "<普通登陆模式>登录成功！<br/>"
response.write ""&waptitle&"欢迎您!!<br/>"
If saytk=100 Then Response.write "</div><div class=""path"">"
response.write "<a href='"&replace(wapgo,"sayou","saytk")&""&rs("sid")&"'>点击返回来源页</a>(6秒后自动返回)<br/>"
If saytk=100 Then Response.write "</div><div class=""content"">"




response.write "----------<br/>"

response.write "温馨提醒:<br/>"
response.write "书签地址中sid="&rs("sid")&"为您的身份标识码, 在做提取地址时要去掉标识,不要泄露给他人.请妥善保管!<br/>"

response.write "<a href=""/bbs/sid.asp?sid="&rs("sid")&"&amp;saytk="&saytk&""">重设登录标识</a>"
response.write "<br/>---------<br/>"
If saytk=100 Then Response.write "</div><div class=""path"">"
Response.write "<a href=""/bbs/show.asp?sid="&rs("sid")&"&amp;saytk="&saytk&""">我的空间</a>"
If saytk=100 Then 
Response.write "</div><div class=""path"">"
Else
response.write "<br/>"
End if
response.write "<a href=""/bbs/index.asp?sid="&rs("sid")&"&amp;saytk="&saytk&""">社区首页</a>"
If saytk=100 Then 
Response.write "</div><div class=""path"">"
Else
response.write "<br/>"
End if
response.write "<a href=""/index.asp?sid="&rs("sid")&"&amp;saytk="&saytk&""">网站首页</a>"
If saytk=100 Then Response.write "</div>"
rs.close
set rs=nothing
conn.close
set conn=nothing
Else
Call saycarda("会员登陆")

dim act
act=trim(request.querystring("act"))
if act<>"" then
Response.Write "您的IP与上次IP不符请重新登录<br/>"
end If

if saytk=>2 then
	Response.write "<form name=""form"" method=""post"" action=""login.asp?saytk="&saytk&"&amp;Action=ok&amp;wapgo="&urls&urlsid&""" method=""post"">"
end If




If saytk=100 Then
%><div class="toper"><img src="/img/logo.jpg" alt="."/></div><%
End If


If saytk=100 Then Response.write "<div class=""path"">"
Response.Write "登陆帐号:(ID或手机号码)<br/>"
If saytk=100 Then Response.write "</div>"
Response.Write "<input name=""user"" type=""text"" format=""*N"" emptyok=""true"" maxlength=""500"" size=""32""/><br/>"
If saytk=100 Then Response.write "<div class=""path"">"
Response.Write "登陆密码:<br/>"
If saytk=100 Then Response.write "</div>"
Response.Write "<input name=""pass"" type=""password"" format=""*M"" emptyok=""true"" maxlength=""500"" size=""32""/><br/>"

if saytk=>2 then 
If saytk=100 Then Response.write "<div class=""path"">"
response.write "<Input value=""1"" type=""hidden"" name=""kie"">"
response.write "模式:<input type=""submit"" name=""submit"" value=""普通登陆""/>"
response.write "-<input type=""submit"" name=""submit"" value=""安全登陆""/></form><br/>"
If saytk=100 Then Response.write "</div><div class=""content"">"

	Response.write "<br/><form name=""form"" method=""post"" action=""/bbs/reg.asp?saytk="&saytk&""">"
response.write "<input type=""submit"" name=""submit"" value=""免费注册""/></form><br/>"


else
Response.write "<anchor title=""登陆"">安全登陆"
	Response.write "<go href=""login.asp?saytk="&saytk&"&amp;Action=ok&amp;wapgo="&urls&urlsid&""" method=""post"">"
	Response.write "<postfield name=""user"" value=""$(user)"" />"
	Response.write "<postfield name=""pass"" value=""$(pass)"" />"
	Response.write "<postfield name=""submit"" value=""安全登陆"" />"
	Response.write "<postfield name=""kie"" value=""1"" />"
	Response.write "</go></anchor>"

    Response.write "|<anchor title=""登陆"">普通登陆"
	Response.write "<go href=""login.asp?saytk="&saytk&"&amp;Action=ok&amp;wapgo="&urls&urlsid&""" method=""post"">"
	Response.write "<postfield name=""user"" value=""$(user)"" />"
	Response.write "<postfield name=""pass"" value=""$(pass)"" />"
	Response.write "<postfield name=""kie"" value=""1"" />"
	Response.write "</go></anchor><br/>"&chr(13)

	Response.write "<a href=""/bbs/reg.asp?saytk="&saytk&""">免费注册</a>"
end if

Response.write "<br/>安全登陆会令原书签中保存的sid失效,能很好地保护帐号的安全!<br/>登录后将用户识别放在URL地址中的sid=xxxxx，登录后请加入书签，下次从书签中访问可自动登录。不要将带有sid=XXX的地址告诉给他人!"

%><br/>===================<br/>
=最新注册前5位=<a href="reg.asp?t=<%=timer()%>&amp;saytk=<%=saytk%>">刷新</a><br/><%

set rs=conn.execute("select top 5 * from [users] order by id desc")
while not rs.eof 
if len(rs("name"))>7 then
response.write left(rs("name"),7)&"*" &" "&left(rs("sjhm"),7)&"****["
 response.write date_dongtai(rs("regtime"))
  response.write"前]<br/>"
else
response.write rs("name")&" "&left(rs("sjhm"),7)&"****["
 response.write date_dongtai(rs("regtime"))
   response.write"前]<br/>"
end if
rs.movenext
wend
rs.close
set rs=nothing

If saytk=100 Then Response.write "</div>"
if saytk<>1 Then
If saytk=100 Then Response.write "<div class=""path"">"
	Response.write "<form name=""form"" method=""post"" action=""/bbs/index.asp?saytk="&saytk&""">"
response.write "<Input value=""社区首页"" type=""submit""></form>>>"

Response.write "<form name=""form"" method=""post"" action=""/index.asp?saytk="&saytk&""">"
response.write "<Input value=""网站首页"" type=""submit""></form><br/>"
If saytk=100 Then Response.write "</div>"
else
Response.write "<br/><a href=""/bbs/index.asp?saytk="&saytk&""">社区首页</a>>>"
Response.write "<a href=""/index.asp?saytk="&saytk&""">网站首页</a>"
end if

end if
call headsay()
%>
