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:
- Consolo sends the password set in the configuration as a variable password. Verify it in the script.
- Consolo sends an ID-value to the script. The value is retrieved from the first column in the List-script.
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>
- The value RESULT must be 0 or 1, decides if the post has been removed or not.
- The value MESSAGE contains a message that will be displayed to the editor.
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>