![]() |
#2
thbwn2007-10-02 11:12
我把关联的前一页"show"发出来,大伙儿看看,这一页有没有问题: <html> <div align="center"> <table width="650" border="0" cellpadding="3" cellspacing="1" borderColorLight=#808080 borderColorDark=#ffffff> </html> [此贴子已经被作者于2007-10-2 11:15:00编辑过] |
这段代码不知道哪有问题,删除所选时数据库记录删除正确,但所有文件都被删除了,不是相关文件被删除,请教各位大侠:
<!--#include file="conn.asp"-->
<%
id= trim(request("id"))
filename=trim(request("filename"))
if id <> "" or filename <> "" then
fileid = split(id,", ")
for i=0 to ubound(fileid)
if fileid(i) <> "" then
sql="delete from [file] where id="&fileid(i)
conn.execute(sql)
end if
next
filedel = split(filename,", ")
for i=0 to ubound(filedel)
set fso=server.createobject("Scripting.filesystemobject")
if fso.fileexists(server.mappath(""&SavePath&"/"&filedel(i)))=true then
fso.deletefile(server.mappath(""&SavePath&"/"&filedel(i)))
End if
next
end if
response.Redirect("show.asp")
%>