⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delete.asp

📁 该学校网站内容界面清新
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
Function checkPermission()
	If Session("admin")<>"" then 
		checkPermission=TRUE
	Else
		checkPermission=FALSE
	End if
End Function

tmp=checkPermission()
If tmp=TRUE then
%>

<% 
  id=Request.Querystring("id")
  if id="" or isnull(id) then
     Response.Redirect("login.asp")
  end if
  sql="select news_content from [imgbook] where ID=" & id
  set rs=server.CreateObject("Adodb.recordset")
  rs.open sql,conn,1,1
  if instr(rs("news_content"),"[uploadimg]") then
	   imgpath=Replace(Replace(rs("news_content"),"[uploadimg]",""),"[/uploadimg]","")
	   imgpath=trim(imgpath)
	   'response.Write(imgpath)
	   set fso = Server.Createobject("Scripting.FileSystemObject") 
	   path = server.MapPath("../upload/" & imgpath)
	   fso.DeleteFile(path)
	   set fso = nothing 
	   conn.execute("delete * from imgbook where ID=" & id)
  else
       conn.execute("delete * from imgbook where ID=" & id)
  end if
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="refresh" content="1;URL=manage.asp?page=<%=request.Querystring("page")%>">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<div align="center"><br>
  <br>
  <br>
  <br>
  <br>
  <a href="javascript:history.back()"><br>
  <font color="#990000" size="2">此图片已被您删除了。请返回! </font></a></div>
</body>
</html>
<%
Else
	response.redirect "../../login.asp?postion=2"
End if
%>

⌨️ 快捷键说明

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