<!-- #include file="opendb.asp"-->
<!-- #include file="md5.asp"-->
<%
  set rs=Server.CreateObject("ADODB.Recordset")
  sqlstr="select * from admin where AdmID='" & Trim(Request.Form("uid")) & "'"
  rs.open sqlstr,conn,1,3
  pwd = Trim(request.form("pwd"))
  pwd = md5(pwd)
  if not rs.eof then
%>
<% 
	if pwd = rs("AdmPS") then
		session("zsb_admid")= rs("ID")
		session("mangflag")	= 1
		session("timeflag")	= rs("timeflag")
		session("zsb_auth")	= rs("Authorization")
		If rs("AdmTP")=True Then
		session("zsb_admtp")="superadm"
		Else
		session("zsb_admtp")="normaladm"
		End If
		'response.redirect("state.asp?state=entersuc")
		Response.Write("<script language=javascript>alert('验证成功，进入管理区！');location.href='manage.asp';</script>")
	else 
		Response.Write("<script language=javascript>alert('密码错误，返回重新输入！');history.back();</script>")
	  	'response.redirect("state.asp?state=entererr")
	end if
  else
    	Response.Write("<script language=javascript>alert('此管理账号不存在！');history.back();</script>")
    	'response.redirect("state.asp?state=entererr")
  end if 
%>