YaWK  24.1
Yet another WebKit
message-fetch.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 
11 include '../../../classes/db.php';
12 include '../../../classes/alert.php';
13 include '../classes/messages.php';
14 
15 $type = $_POST['type'];
16 
17 echo "HUHU!!! $type";
19 
20 // FETCH DATA
21 if ($type === "all"){
22  $sql = mysqli_query($connection, "SELECT * FROM"." ".$dbprefix."plugin_msg WHERE msg_to = '".$username."' AND trash ='0' AND spam ='0' ORDER BY msg_read,msg_date DESC");
23 }
24 elseif ($type === "trash"){
25  $sql = mysqli_query($connection, "SELECT * FROM"." ".$dbprefix."plugin_msg WHERE msg_to = '".$username."' AND trash ='1' AND spam ='0' ORDER BY msg_read,msg_date DESC");
26 }
27 elseif ($type === "spam"){
28  $sql = mysqli_query($connection, "SELECT * FROM"." ".$dbprefix."plugin_msg WHERE msg_to = '".$username."' AND trash ='0' AND spam ='1' ORDER BY msg_read,msg_date DESC");
29 }
30 $messages = array();
31 while ($row = mysqli_fetch_assoc($sql)){
32  $messages[] = $row;
33 }
34 return $messages;
35 }
36 else {
37  return "Something strange has happened. Are you logged in? Please re-login.";
38 }
exit
$type
if($type==="all") elseif($type==="trash") elseif($type==="spam") $messages
$sql
Definition: message-new.php:32