del.asp

来自「一套开源WEB的网站管理系统」· ASP 代码 · 共 55 行

ASP
55
字号
<!--#include file="config.asp"-->
<%
If Newasp.CheckPost = False Then
	Call OutAlertScript("<li>您提交的数据不合法,请不要从外部提交。</li>")
	Response.End
End If

If Cint(Newasp.membergrade) = 999 Or Trim(Session("AdminName")) <> "" Then
	If Newasp.ChkNumeric(Request("guestid")) > 0 Then
		If Newasp.ChkNumeric(Request("replyid")) > 0 Then
			Call DelGuestReply
		Else
			Call DelGuestBook
		End If
	Else
		Call OutAlertScript("错误的系统参数!")
	End If
Else
	Call OutAlertScript("本页面为管理专用,您没有权限登陆本页!")
End If
CloseConn
'================================================
'过程名:DelGuestBook
'作  用:删除留言
'================================================
Sub DelGuestBook()
	Dim guestid
	If Not IsNumeric(Request("guestid")) Then
		Call OutAlertScript("错误的系统参数!")
		Exit Sub
	Else
		guestid = CLng(Request("guestid"))
	End If
	Newasp.Execute("DELETE FROM NC_GuestBook WHERE guestid="& guestid)
	Newasp.Execute("DELETE FROM NC_GuestReply WHERE guestid="& guestid)
	Call OutputScript("删除留言成功!","index.asp")
End Sub
'================================================
'过程名:DelGuestReply
'作  用:删除回复留言
'================================================
Sub DelGuestReply()
	Dim replyid,guestid
	If Not IsNumeric(Request("replyid")) Or Not IsNumeric(Request("guestid")) Then
		Call OutAlertScript("错误的系统参数!")
		Exit Sub
	Else
		replyid = CLng(Request("replyid"))
		guestid = CLng(Request("guestid"))
	End If
	Newasp.Execute("DELETE FROM NC_GuestReply WHERE id="& replyid)
	Newasp.Execute ("UPDATE NC_GuestBook SET ReplyNum=ReplyNum-1 WHERE guestid="& guestid)
	Call OutputScript("删除回复成功!","index.asp")
End Sub
%>

⌨️ 快捷键说明

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