<!--#include file="../siteconfig/conn.asp"-->
<!--#include file="../siteconfig/md5.asp"-->
<%
mofei=trim(request.form("mofei"))
if cstr(session("getcode"))<>cstr(mofei) then
	Response.Write("<script language=javascript>alert('你输入的验证码有误');this.location.href='login.asp';</script>")
	response.end
end if
dim username,password
Admin_UserName=Request.Form("Admin_UserName")
Admin_UserPass=Request.Form("Admin_UserPass")
Admin_UserPass=md5(Admin_UserPass)
set rs=server.createobject("adodb.recordset")
sql="select * from admin where Admin_UserName='"&Admin_UserName&"' and Admin_UserPass='"&Admin_UserPass&"'"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
	rs.close
	set rs=nothing
	Response.Write("<script language=javascript>alert('请输入正确的用户名和密码');this.location.href='login.asp';</script>")
	Response.End
else
	rs("Admin_Logincount")=rs("Admin_Logincount")+1
	rs("Admin_LoginTime")=now()
	rs("Admin_LoginIP")=Request.ServerVariables("REMOTE_ADDR")
	rs.Update
	Session("Admin_UserName")=rs("Admin_UserName")
	Session("adminlogin")=sessionvar
	Session("Admin_Verity")=rs("Admin_Verity")
	Session.timeout=900
	rs.close
	set rs=nothing
	Response.Redirect ("index.asp")
end if
conn.close
set conn=nothing
%>
