📄 deleteart.asp
字号:
<!--#include file="opendb.asp"-->
<html>
<head>
<script language=vbscript src="function.vbs" ></script>
</head>
<body>
<%
ID=request.QueryString("index")
strSQL = "Select Username from Forum Where ID=" & ID
rst.CursorType=3
rst.open strSQL
if rst.RecordCount>0 then
author=rst("Username")
end if
%>
<%if session("UserName")<> author and session("UserName")<> "admin" then%>
<script language=vbscript>
msgbox "只有管理员或帖子的所有者才可以删除该帖子",48,"无权限删除帖子"
window.location="index.asp"
</script>
<%else%>
<%
strSQL="DELETE FROM Forum WHERE ID ='"+id+"'"
my_conn.Execute StrSql
strSQL="DELETE FROM Forum WHERE AnswerID ='"+id+"'"
my_conn.Execute StrSql
%>
<%end if%>
<!--#include file="closedb.asp"-->
<script language=vbscript>
msgbox "帖子已删除",48,"删除成功"
window.location="index.asp"
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -