<!--#include file="conn.asp"-->
<!--#include file="../../inc/filter.asp"-->
<!--#include file="../../inc/md5.asp"-->
<%
Rem 登陆验证
sub logon_valid()
	username=trim(request("username"))
	password=trim(request("password"))
	
	if(username="" or password="") then
%>
		<script language="javascript">
			alert("管理员用户名或密码不能为空");
			window.location='logon.asp';
		</script>
<%
	else
		if(ChkBadWord(username)<>0 or ChkBadWord(password)<>0) then
%>
			<script language="javascript">
				alert("管理员用户名或密码中包含非法字符");
				window.location='logon.asp';
			</script>
<%
		else
			set rs_logon=Server.CreateObject("ADODB.RecordSet")
			rs_logon.open "select * from [fksf_admin] where adminname='"&username&"' and adminpwd='"&MD5(password)&"'",conn,1,1
			if(rs_logon.eof) then
				rs_logon.close()
				set rs_logon=nothing
%>
				<script language="javascript">
					alert("管理员用户名或密码错误");
					window.location='logon.asp';
				</script>
<%
			else
				rs_logon.close()
				set rs_logon=nothing
				session("adminname")=username
				response.Redirect("main.asp")
			end if
		end if
	end if
end sub
%>