YaWK  24.1
Yet another WebKit
message-delete.php
Go to the documentation of this file.
1 <?php
2 /*
3 if (!isset($_POST['token'])) {
4  die ('no direct access allowed.');
5 }
6 else if ($_POST['token'] != "U3E44ERG0H0M3") {
7  die ('no direct access allowed!');
8 }
9 */
10 include '../../../classes/db.php';
11 include '../../../classes/alert.php';
12 include '../classes/messages.php';
13 
14 /* set database object */
15 if (!isset($db))
16 { // create new db object
17  $db = new \YAWK\db();
18 }
19 
20 $msg_id = $_POST['msg_id'];
21 
22 // UPDATE STATEMENT
23 if ($db->query("DELETE FROM {plugin_msg} WHERE msg_id = '".$msg_id."'"))
24 {
25  echo "message deleted";
26 }
27 else
28 {
29  echo \YAWK\alert::draw("danger", "Ooops, Sorry!", "Could not delete message, please try again.","",2000);
30 }
if(!isset($db)) $msg_id