<body>
<%
user=trim(request.Form("username"))
pass=trim(request.Form("password"))
if user="" then
showmsg "用户名不能为空","login.asp"
end if
if pass="" then
showmsg "密码不能为空","login.asp"
end if
md5psd=md5(pass)
set rst=server.createobject("adodb.recordset")
sql="select * from user where user='"& user &"'"
rst.open sql,conn,1,3
if rst.eof then
showmsg "用户名不存在","login.asp"
response.end()
end if
if md5psd<>rst("psd") then
showmsg "密码不正确,请从新输入","login.asp"
response.End()
end if
session("id")=rst(0)
response.Cookies("CookieName")("account")=user
response.Cookies("CookieName").Expires = Date()+1
rst("lasttime")=date()
rst.update()
rst.close
set rst=nothing
response.Redirect("index.asp")
response.End()
%>
<%rst.close
set rst=nothing
conn.close
set conn=nothing %>
</body>
</html>