goodsimagedelt.asp

来自「A Design and Implementation of The Onli」· ASP 代码 · 共 36 行

ASP
36
字号
<!--#include File="../conndb.asp"-->
<!--#include file="isAdmin.asp"-->
<html>

<head>
<title>删除图片信息</title>
<style>BODY {	FONT-SIZE: 9pt}
TD {	FONT-SIZE: 9pt}
</style>
</head>
<body>

<%
  Dim ImageFile,id
  '读取商品编号参数
  id = Request.QueryString("id")
  '读取指定商品的数据到记录集rs
  Set rs = Conn.Execute("SELECT * FROM Goods WHERE id="&id)
  If Not rs.EOF Then
    ImageFile = rs("ImageFile")
    '删除图片
    filename = Server.MapPath("images\"&ImageFile)
    Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
    If (MyFileObject.FileExists(trim(filename))) Then
      MyFileObject.DeleteFile trim(filename)
      '更新表Goods中此商品的图片信息
      conn.execute("Update Goods set ImageFile='' where id="&id)
    End If
  End If
%>
<script language="JavaScript">
  opener.location.reload();
  window.close();
</script>
</body>
</html>

⌨️ 快捷键说明

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