<%
on error resume next
set conn=server.createobject("adodb.connection")
conn.open connstr
if err then
response.write ""&issqlver&"数据库教程连接出错,请检查连接字串。
"&err.source&" ("&err.number&")"
set conn = nothing
err.clear
response.end
end if
dim expires,userpass
username=request("username")
userpass=md5(request("userpass"),16)
expires=request("issave")
if username<>"test" then
set rs=server.createobject("adodb.recordset")
rs.open"select * from lg50_my_user where username='"&username&"' and password='"&userpass&"'",conn,1,3
if rs.eof and rs.bof then
rs.close
set rs=nothing
response.write("")
response.end
else
response.cookies(cookiesname)("username")=username
if int(expires)>0 then response.cookies(cookiesname).expires = date+expires
response.redirect ("index.asp")
end if
else
response.cookies(cookiesname)("username")=username
response.redirect ("index.asp")
response.end
end if
%>