attach_del2.asp

来自「是一个关于小学信息化教育的平台,提供了学校论坛,和聊天室功能!」· ASP 代码 · 共 36 行

ASP
36
字号
<!--#INCLUDE FILE="../../INCLUDE/DB.ASP"-->
<!--#INCLUDE FILE="power.ASP"-->
<%

Set conn = OpenOrGet_Database("sql_conn")

myid=trim(request("id"))
if myid="" or (not isnumeric(myid)) then
     Response.Write "<script language=javascript>"
      Response.Write "alert('没有相关记录,请重新选择!!');"
      Response.Write "history.go(-1);"
      Response.Write "</script>"
	  Response.End
end if
checksql="select id,attach from content where id='"&myid&"'"
set Rs=open_rs(conn,checksql)
if Rs.eof then
     Response.Write "<script language=javascript>"
      Response.Write "alert('没有相关记录,请重新选择!!');"
      Response.Write "history.go(-1);"
      Response.Write "</script>"
	  Response.End
end if

imagepath ="/admin/content/"
'检索图片实体是否存在
set checkFile=Server.createObject("Scripting.FileSystemObject")
if checkFile.fileExists(server.mappath(imagepath&Rs("attach"))) then
	checkFile.deleteFile server.mappath(imagepath&Rs("attach"))
end if

rs("attach")=""
rs.update

response.redirect "content_modi2.asp?id="&myid
%>

⌨️ 快捷键说明

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