📄 deletepost.asp
字号:
<%
' Project Name: Simple Blog
' Version: 1.1
' Author: James Tang
' Email: fwsous@gmail.com
' Web site: www.fwso.cn
' Copyright (C) 2008 James Tang. All Rights Reserved.
'
' Note: This program can be used for any purpose for free.
'
%>
<!--#include file="conn.asp"-->
<%
Dim posts, sql, rs, postIDs, counter, errorMsg, responseData, statusCode
statusCode = false
posts = split(Request.Form("post_ids"), "#")
postIDs = "("
For counter = 0 To UBound(posts) - 1
postIDs = postIDs + posts(counter) + ","
Next
postIDs = postIDs + posts(UBound(posts)) + ")"
sql = "DELETE FROM articles WHERE article_id IN " + postIDs
On Error Resume Next
conn.Execute sql
sql = "SELECT * FROM articles WHERE article_id IN" + postIDs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql, conn, 1,1
If rs.EOF or rs.BOF then
statusCode = "true"
End if
rs.close
Set rs = nothing
If Err <> "" then
errorMsg = "Error Number: " + Err.Number + "Error Description: " + Err.description
End if
responseData = "{"
responseData = responseData + """status"":" + statusCode + ","
responseData = responseData + """error"":""" + errorMsg + """"
responseData = responseData + "}"
Response.Write(responseData)
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -