del.asp

来自「视频源代码 视频源代码」· ASP 代码 · 共 40 行

ASP
40
字号
<%response.expires=0%>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/vip.asp"-->
<%
if not adminlevel=1 then
  call msgbox("您的级别不够!",0)
end if

id	=strFilter(request("id"),10)
if id="" then
  call msgbox("请确定要删除的新闻!",1)
end if
if not isnumeric(id) then
  call msgbox("请确定要删除的新闻!",1)
end if

sql="select top 1 title,path from news where id="&id
rs.open sql,conn,1,1
if not rs.eof then
  title	= rs(0)
  path	= rs(1)
else
  rs.close
  call msgbox("该新闻不存在!",1)
end if
rs.close

if IsObjInstalled("Scripting.FileSystemObject") then
  Set fs=server.CreateObject("Scripting.FileSystemObject")
  if fs.FileExists(systempath&"\"&path&id&".htm")=true Then
    fs.DeleteFile systempath&"\"&path&id&".htm"
  end if
  Set fs=nothing
end if

rs.open "delete from newsphoto where filenum="&id,conn,1,3
rs.open "delete from news where id="&id,conn,1,3

call msgbox("新闻 " & title & " 成功删除!","../news/default.asp?categoryid="&Session("categoryid"))
%>

⌨️ 快捷键说明

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