Database Register

Script for Deleting

The file set in the database register’s value Delete will be called by Consolo when the editor wants to delete an existing new post.

 

Request sent to the script by POST:

 

Response from the script should be given in the following format:

<?xml version="1.0" encoding="ISO-8859-1"?>
<RESPONSE>
  <RESULT>0/1</RESULT>
  <MESSAGE>Message</MESSAGE>
</RESPONSE>

 

Thanks to this solution you can verify if the post can be removed or not and alert the editor about what went wrong.

Exemple

The example shows how to create a script for deleting in SQL-connected ASP. If you are using another environment on your server, please translate the script to the suitable language.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- #INCLUDE VIRTUAL='/includes/incDbConnect.asp' -->
<% If Request("password") <> "abc123" Then Response.End
SQLstr = "DELETE FROM Presscutting_T WHERE Presscutting_ID = " & Request("id")
Connect.Execute(SQLstr)
%>
<RESPONSE>
  <RESULT>1</RESULT>
  <MESSAGE>Data has been deleted.</MESSAGE>
</RESPONSE>