<!--#include file = "setup.asp"-->
<!--#include file = "conn.asp"-->
<!--#include file = "md5.asp"-->
<%
user = request.Form("user")
pass = md5(Request("pass"))
safecode = request.Form("safecode")
If user = "" Then
    response.Write("<script language=javascript>alert('用户名不能为空!');history.go(-1)</script>")
    response.End
End If

If pass = "" Then
    response.Write("<script language=javascript>alert('密码不能为空!');history.go(-1)</script>")
    response.End
End If

if cstr(session("getcode"))<>cstr(trim(request("verifycode"))) then
response.Write "<script LANGUAGE='javascript'>alert('请输入正确的验证码！');history.go(-1);</script>"
response.end
end if

sql = "select * from admin where user='"&user&"' and pass='"&pass&"'"
Set rs = conn.Execute(sql)
If rs.EOF Or rs.bof Then
    response.Write ("<script language=javascript>alert('帐号或者密码错误，请重新输入!');history.go(-1)</script>;")

Else

    session("user") = user
	session.timeout=60 
    response.redirect "admin/tz_admin_index.asp"
End If

%>
