<!--#include file="Conn.asp"-->
<!--#include file="MD5.asp"-->
<!--#include file="Char.asp"-->
<% 
Dim server_v1
Dim server_v2
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER")) 
server_v2=Cstr(Request.ServerVariables("SERVER_NAME")) 
if mid(server_v1,8,len(server_v2))<>server_v2 then 
response.write "<br><br><center><table border=0 cellpadding=20 width=450>" 
response.write "<tr><td>" 
response.write "不要外部提交,跳过Http提交吧!" 
response.write "</td></tr></table></center>" 
response.end 
end if 
%>
<%
ChkNum = Request.Form("ChkNum")
If ChkNum="" Or Cstr(ChkNum)<>Cstr(Session("ChkNum")) Then
%>
<Script Language="JavaScript">
alert("验证码有误或者没填写,请返回!");
window.document.location.href="admin.htm";
</Script>
<%
Else
kname=killstr(Trim(Request.Form("name")))
passa=MD5(Request.Form("pass"))
Set ch = conn.execute("Select * From [Manager] Where [Admin]='"&kname&"' and [PassWord] = '"&passa&"'")
If ch.Eof and ch.Bof Then
Dim Str
Str = "用户名:"&kname&" 密码:"&Request.Form("pass")&" <font color=red>错误登陆</font>"
JaSys(Str)
%>
<Script Language="JavaScript">
alert("密码或者用户错误,请返回!");
javascript:history.go(-1);
</Script>
<%
Else
ip = Request.ServerVariables("REMOTE_ADDR") 
k = now()
Set ino = conn.execute("update [Manager] Set [IP] = '"&ip&"',[InTime]='"&k&"' Where [Admin] = '"&kname&"'")
Dim Ystr
Ystr = "管理员"&kname&"<font color=red>登陆系统</font>" 
JaSys(Ystr)
session("ManagerUser")=kname
session("ManagerPwd")=passa
Session.Timeout = 60
Response.Redirect("Adminindex.asp")
End If
ch.close
Set ch = nothing
ino.close
Set ino = nothing
End if
%>



