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

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

cn.execute ("delete from Show5_ALLArticle where ArticleID="&articleid&"")
cn.execute ("delete from Show5_Articlecomment where ArticleID="&articleid&"")

set rs1 = server.CreateObject("adodb.recordset")
sql="select * from Show5_ArticleSysGroup where GroupID="&rs("SysGroupID")&""
rs1.open sql,cn,1,3
rs1("ArticleNum")=rs1("ArticleNum")-1
rs1.update
rs1.close
set rs1=nothing
Response.write("<script>alert('成功删除文章！');window.location.replace('articlelist.asp?Username="&rs("Username")&"');</script>")
rs.close
set rs=nothing
%>
