?? xinxi_del.asp
字號:
<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<%
dim rs,sql,id,i,str2,username,tupian,objFSO,fileExt,sql1,rs1,sql2
username=request.cookies("cnmai")("username")
id=trim(request("selectedid"))
if trim(id)="" then
response.write "<script language=JavaScript>" & chr(13) & "alert('沒有選擇記錄!');" & "history.back()" & "</script>"
response.end
end if
str2=split(id,",")
set rs=server.createobject("adodb.recordset")
for i=0 to ubound(str2)
sql="select * from [xinxi] where id="&cstr(str2(i))
rs.open sql,conn,1,1
'On Error Resume Next
if rs("tupian")<>"0" then
tupian=rs("tupian")
fileExt=lcase(right(tupian,4))
if (fileEXT=".gif" or fileEXT=".jpg" or fileEXT=".jpeg") and left(tupian,4)<>"http" then
call deltu()
end if
else
end if
rs.close
sql="delete from [xinxi] where id="&cstr(str2(i))
rs.open sql,conn,1,3
sql1="delete from [shoucang] where scid='"&cstr(str2(i))&"' "
rs.open sql1,conn,1,3
sql2="delete from [hf] where xxid='"&cstr(str2(i))&"' "
rs.open sql2,conn,1,3
next
sub deltu()
dim whichfile
whichfile=server.mappath("\"& tupian & "")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if objFSO.fileExists(whichfile) then
objFSO.DeleteFile(whichfile)
end if
set objfso=nothing
end sub
response.write "<script language=JavaScript>" & chr(13) & "alert('刪除信息成功!')</script>"
response.write "<meta http-equiv=refresh content=""1;URL=xinxi.asp"">"
response.end
rs.close
set rs=nothing
closedb
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -