delmsg.asp

来自「网络教学管理系统」· ASP 代码 · 共 39 行

ASP
39
字号
<!--#include file="inc/conn.asp" -->
<!--#include file = "CheckLogin.asp" -->
<!--#include file = "inc/zhuru.asp" -->
<%
	Dim strID ,strSql ,rs ,rs1 ,strType ,strUrl
	strID = Request.QueryString("ID")
	strType = Request.QueryString("Type")
	If strType = "" Then
		strType = "r"
	End If
	
	If strType = "r" Then
		strUrl = "Index_Msg.asp"
	ElseIf strType = "s" Then
		strUrl = "Index_Msg_s.asp"
	End If
	If strID & "" = "" Then
		Response.Write("参数错误!")
		Response.End
	End If
	Set rs = Server.CreateObject("ADODB.RecordSet")
	strSql = "SELECT * FROM Msg WHERE ID ="& strID 
	rs.open strSql,conn,1,1
	If rs.EOF Then
		Response.Write("对不起,无此短信息!")
		Response.End
	Else
		If rs("ManTo") <> Session("UserName")  Then
			If rs("ManFrom") <> Session("UserName") Then
				Response.Write("对不起,你没有权限删除此短信息!")
				Response.End
			End If
		End If
	End If
	strSql = "DELETE FROM Msg  WHERE ID = "& strID
	Set rs1 = Server.CreateObject("ADODB.RecordSet")
	rs1.open strSql,conn,3,1
	Response.Redirect(strUrl)
%>

⌨️ 快捷键说明

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