admin.asp

来自「使用Asp+Access+FSO+Jmail+Servu开发」· ASP 代码 · 共 33 行

ASP
33
字号
<!--#include file="../inc/conn.asp"-->
<%
if Request.Cookies("name")="" or Request.Cookies("pwd")="" or Request.Cookies("flag")="" then
Response.write"<script>alert('对不起,您还没有登录或登录超时,请重新登录!');top.location.href='login.asp'</script>"
response.End
end if
set rs2=Server.CreateObject("adodb.recordset")
sql2="select * from manage_user where username='"&Request.Cookies("name")&"' and lock=0"
rs2.open sql2,conn,1,1
if rs2.eof and rs2.bof then
Response.Cookies("name")=""
Response.Cookies("pwd")=""
Response.Cookies("time")=""
Response.Cookies("flag")=""
response.redirect("../error.asp?error=other")
response.End
end if
function chk_admin_login(chk_flag)
if cint(Request.Cookies("flag")) < chk_flag then
response.Write("<script>alert('对不起,您没有权限执行此操作!');location.href='javascript:history.back()'</script>")
response.End()
end if
end function
if request("action")="loginout" then
response.buffer=true
response.expires=0
Response.Cookies("name")=""
Response.Cookies("pwd")=""
Response.Cookies("time")=""
Response.Cookies("flag")=""
Response.write "<script>alert('已经成功退出!');top.location.href='login.asp'</script>"
end if
%>

⌨️ 快捷键说明

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