<%@language=vbscript codepage=936 %>
<!--#include file="../connoklin.asp"-->
<!--#include file="../inc/md5.asp"-->
<%'判断访问来源，如果不是本部则无法访问
  sub checkPrePage()
	 url=request.ServerVariables("HTTP_REFERER")
	 url=trim(replace(url,"http://",""))
	 url=trim(left(url,len(request.ServerVariables("SERVER_NAME"))))
	 if url<>trim(request.ServerVariables("server_name")) then
	  response.Write "<strong><font color=red>严重警告：非法访问!</font></strong><br>以任何方式攻击、影响本站的正常运转都是一种犯法的行为，都将承担法律责任！"
	  response.End()
	 end if
  end sub
  '检查来源,拒绝非法入侵者
Call checkPrePage()
  %>
<%
UserName = replace(Request("UserName"),"'","‘")
Password = replace(Request("password"),"'","‘")
if FoundErr<>True then
	password=md5(password)
end if 
SQL = "Select * From admin"
Set RS = Conn.Execute(SQL)
do until rs.eof
If username = RS("UserName") AND Password = RS("Password") Then
 session("AdminName")=rs("ID")
 Response.Redirect "index.asp"
Else
rs.movenext
End If
loop
      response.write"<script>alert('用户登录失败，请输入正确帐号和密码重新登录！！');</script>"
      response.write"<script>location.href='admin_login.asp';</script>"
RS.Close
Set RS = Nothing
%>