📄 xinxi_del.asp
字号:
<!--#include file=conn1.asp-->
<!--#include file=usercookies.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 c,tupian from [xinxi] where username='"&username&"' and id="&cstr(str2(i))
rs.open sql,conn,1,1
'On Error Resume Next
if rs("c")=1 then
tupian=rs("tupian")
fileExt=lcase(right(tupian,4))
if fileEXT=".gif" or fileEXT=".jpg" then
call deltu()
end if
end if
rs.close
sql="delete from [xinxi] where username='"&username&"' and id="&cstr(str2(i))
rs.open sql,conn,1,3
sql1="delete from [shoucang] where username='"&username&"' and 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
response.write "<script language=JavaScript>" & chr(13) & "alert('删除信息成功!');" & "window.location='user_xxgl.asp'" & "</script>"
response.end
rs.close
set rs=nothing
closedb
sub deltu()
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if objFSO.fileExists(Server.MapPath("uptupian\"&tupian)) then
objFSO.DeleteFile(Server.MapPath("uptupian\"&tupian))
end if
set objfso=nothing
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -