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

set rs = server.CreateObject("adodb.recordset")
sql="select * from Show5_ALLMessage where MessageID="&messageid&""
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('messagelist.asp?Username="&rs("Username")&"');</script>")
rs.close
set rs=nothing
Response.end()
end if

cn.execute ("delete from Show5_ALLMessage where MessageID="&messageid&"")
cn.execute ("delete from Show5_ALLReMessage where MessageID="&messageid&"")
Response.write("<script>alert('成功删除留言！');window.location.replace('messagelist.asp?Username="&rs("Username")&"');</script>")
rs.close
set rs=nothing
%>
