<!--#include file="conn.asp"-->
<!--#include file="../md5.asp"-->
<%
session.Timeout=100   '登陆超时时间(单位为分钟)
dim admin,password
admin=replace(trim(request("admin")),"'","")
password=md5(replace(trim(request("password")),"'",""))
if IsNumeric(request("verifycode"))=False or IsNumeric(request("verifycode"))="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误-请输入数字验证码');"
		response.write"javascript:history.go(-1)</SCRIPT>"
        response.end
		end if
if request("verifycode")="" then
	response.write "<script LANGUAGE='javascript'>alert('请输入确认码！');history.go(-1);</script>"
	response.end
elseif session("VerifyCode")="" then
	response.write "<script LANGUAGE='javascript'>alert('请不要重复提交，如需重新登陆请返回登陆页面！');history.go(-1);</script>"
	response.end	
elseif csng(Session("VerifyCode"))<>csng(Request.Form("VerifyCode")) then
	response.write "<script LANGUAGE='javascript'>alert('您输入的确认码有误，请重新输入！');history.go(-1);</script>"
	response.end
end if

set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from wq_admin where admin='"&admin&"' and password='"&password&"' " ,conn,1,1
if not(rs.bof and rs.eof) then
if password=rs("password") then
session("admin")=trim(rs("admin"))
session("flag")=int(rs("flag"))
rs.Close
set rs=nothing
response.Redirect "index.asp"
else
response.write "<script LANGUAGE='javascript'>alert('登陆失败，请检查您的登陆名和密码！');history.go(-1);</script>"
end if
else
response.write "<script LANGUAGE='javascript'>alert('登陆失败，请检查您的登陆名和密码！');history.go(-1);</script>"
end if
%>