del.asp

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

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

categoryid=strFilter(request("categoryid"),10)
if categoryid="" then
  call msgbox("请正确指定分类!",1)
end if
if not isnumeric(categoryid) then
  call msgbox("请正确指定分类!",1)
end if

sql="select top 1 categoryname,categoryindex,categorysort from category where categoryid=" & categoryid
rs.open sql,conn,1,1
if not rs.eof then
  cname=rs(0)
  cindex=rs(1)
  csort=rs(2)
else
  rs.close
  call msgbox("该分类不存在!",1)
end if
rs.close

sql="select categoryindex from category where categoryindex like '" & cindex & ".%'"
rs.open sql,conn,1,1
if not rs.eof then
  rs.close
  call msgbox("该分类 ["&cname&"] 存在子分类,必须把全部子分类删除!",1)
end if
rs.close

rs.open "delete from category where categoryid=" & categoryid,conn,1,3
rs.open "delete from "&csort&" where categoryid like '." & categoryid & ".%'",conn,1,3
rs.open "delete from "&csort&"photo where categoryid=" & categoryid,conn,1,3

call msgbox("成功删除分类 ["&cname&"] ,及所属该类的一切内容!","default.asp")
%>

⌨️ 快捷键说明

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