<!--#include file="conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file=../inc/ipt.asp-->

<%

dim username,password,rs,sql,k
if request.cookies("admincnmai")("errs")="" then
k=0
else
k=request.cookies("admincnmai")("errs")
end if
if request.cookies("admincnmai")("errs")>5 then
response.write"<br>您输入的密码错误次数太多，系统保护中。"
response.end
end if
username=replace(trim(request("username")),"'","‘")
password=md5(replace(trim(request("password")),"'","‘"))
if UserName="" then
response.write"用户名不能为空！"
end if
if Password="" then
response.write"<br>密码不能为空！"
end if
chkcnmai(username)
if nothaveChinese(username)=false then
response.write"<br>用户名不能是中文。"
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [jle_admin] where UserName='"&UserName&"' and password='"&password&"'"
rs.open sql,conn,1,3
if rs.eof then
Response.cookies("admincnmai")("errs")=k+1
response.write"<br>您输入的密码错误。"
Response.Redirect "admin_login.asp"
response.end
else
Response.cookies("admincnmai")("username")=rs("username")
Response.cookies("admincnmai")("max")=rs("max")
Response.cookies("admincnmai")("domain")=Request.ServerVariables("SERVER_NAME")
end if
rs.close
set rs=nothing
closedb
Response.Redirect "index.asp"
%>