%
echo ob_get_contents(zych_templatedir&"u_login.htm")
%>
<%if Request.QueryString("login")="ok" then
ausername=request.Form("username")
password=md5(Request("password"))
if ausername="" then
response.Write("")
response.end
end if
if Request("password")="" then
response.Write("")
response.end
end if
sql="select * from [user] where username='"&ausername&"' and userpassword='"&password&"'"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
response.Write("")
response.End
end if
if rs("sh")=0 then
response.Write("")
response.End()
end if
session("username")=rs("id")
session("key")=rs("key")
sql="update [user] set dlcs=dlcs+1 where id="&session("username") '登陆次数+1
conn.execute(sql)
sql="update [user] set dldata=#"&now&"# where id="&session("username") '记录登陆时间
conn.execute(sql)
Response.Write("")
end if
if request("register")="ok" then
ip=request.servervariables("remote_addr")
ausername=replace(trim(request.form("username")),"'","")
userpassword=replace(trim(Request.form("userpassword")),"'","")
userpassword2=replace(trim(Request.form("userpassword2")),"'","")
zsname=request.form("zsname")
tel=request.form("tel")
qq=request.form("qq")
VerifyCode=request.form("VerifyCode")
if ausername="" then
response.write ""
response.end
end if
letters="0123456789abcdefghijklmnopqrstuvwxyz"
username=Lcase(trim(Request.Form("username")))
for i=1 to len(username)
u=mid(ausername,i,1)
if Instr(letters,u)=0 then
response.write ""
response.end
end if
next
if len(ausername)<2 or len(ausername)>12 then
response.write ""
response.end
end if
if userpassword="" or userpassword2="" then
response.write ""
response.end
end if
if userpassword<>userpassword2 then
response.write ""
response.end
end if
letters="0123456789abcdefghijklmnopqrstuvwxyz"
userpassword=Lcase(trim(Request.Form("userpassword")))
for i=1 to len(userpassword)
u=mid(userpassword,i,1)
if Instr(letters,u)=0 then
response.write ""
response.end
end if
next
if len(userpassword)<6 or len(userpassword)>20 then
response.write ""
response.end
end if
if zsname="" then
response.write ""
response.end
end if
if tel="" then
response.write ""
response.end
end if
if qq="" then
response.write ""
response.end
end if
if VerifyCode="" then
response.Write("")
response.end
end if
if cstr(Session("firstecode"))<>cstr(Request.Form("VerifyCode")) then
response.Write("")
response.End
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where username='"&ausername&"'"
rs.open sql,conn,1,3
if not rs.eof then
response.write ""
response.end
end if
rs.addnew
rs("username")=ausername
rs("userpassword")=md5(request.form("userpassword"))
rs("zsname")=zsname
rs("ip")=ip
rs("tel")=tel
rs("qq")=qq
rs("key")=1
rs("sh")=usersh
rs.update
rs.close
set rs=nothing
conn.close
set rs=nothing
Response.Write ""
end if %>