admin_ok.asp

来自「非常一般」· ASP 代码 · 共 45 行

ASP
45
字号
<!--#include file="Admin_Conn.asp"-->
<!--#include file="../Inc/Config.asp" -->
<!--#include file="../Inc/Function.asp"-->
<!--#include file="../Inc/Md5.asp" -->
<%
 If Web_safe Then
   From_url = Cstr(Request.ServerVariables("HTTP_REFERER"))
   Serv_url = Cstr(Request.ServerVariables("SERVER_NAME"))
   if mid(From_url,8,len(Serv_url)) <> Serv_url then
     response.write"<script language=JavaScript>{window.alert('对不起,本系统开启了防外部数据提交');window.location.href='javascript:window.close()'}</script>"
     response.end
   end if
 End if
%>
<%
  name=Eck(request.form("Admin_User"))
  pass=Md5(Eck(request.form("Admin_Pass")),Pmode)
  
  
  Sql="select * from Admin where Admin_User='"&name&"'"
  Set rs=Server.CreateObject("ADODB.RecordSet") 
  Rs.Open sql,conn,1,1

  If Not Rs.eof then
    If Rs("Admin_Pass") <> pass Then
      response.write"<script language=JavaScript>{window.alert('对不起,密码错误');window.location.href='javascript:history.go(-1)'}</script>"
    Else
      If rs("Admin_Lock") =0 then
        rs("Admin_Datetime") = now()
        rs("Admin_Ip") = Request.ServerVariables("REMOTE_ADDR")
        rs.Update   
        Session("Admin_User")=rs("Admin_User")
        Session("Admin_Ok")=True
        Session.timeout=900
        Response.Redirect "Admin_main.asp"
      Else
        response.write"<script language=JavaScript>{window.alert('您的帐号由于您的操作不当,已经被管理员锁定!如有问题,请联系管理员!');window.location.href='javascript:history.go(-1)'}</script>"
      End if
    End if
  Else
    response.write"<script language=JavaScript>{window.alert('对不起,帐号不存在');window.location.href='javascript:history.go(-1)'}</script>"
  End if
  Rs.close
  Set rs = nothing
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?