<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../include/connect.asp" -->
<%
ttid=Checkstr(request.querystring("ttid"))

set rs = server.CreateObject("adodb.recordset")
sql="select * from Show5_ALLTT where TTID="&ttid&""
rs.open sql,cn,1,1

if rs.eof or rs.bof then
Response.write("<script>alert('找不到此照片！');history.back(-1);</script>")
Response.end()
elseif rs("Username") <> session("username") then
Response.write("<script>alert('您没有权限！');window.location.replace('ttlist.asp?Username="&rs("Username")&"&viewmode=1');</script>")
rs.close
set rs=nothing
Response.end()
end if

cn.execute ("delete from Show5_ALLTT where TTID="&ttid&"")
cn.execute ("delete from Show5_TTcomment where TTID="&ttid&"")
Set fso = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
fso.DeleteFile("E:\Wwwroot\show5net\UserTT\"&rs("Username")&"\"&rs("Filename")&"")
fso.close
set fso=nothing
Response.write("<script>alert('成功删除拍贴！');window.location.replace('ttlist.asp?Username="&rs("Username")&"&viewmode=1');</script>")
rs.close
set rs=nothing
%>
