-
Notifications
You must be signed in to change notification settings - Fork 10
/
_Inbox.php
43 lines (32 loc) · 1.13 KB
/
_Inbox.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
$page_url = explode(".", $_SERVER['REQUEST_URI']);
$_SERVER['REQUEST_URI'] = $page_url[0].".php";
if($_SERVER['REQUEST_URI'] == "/_Inbox.php"){
exit();
}
if (isset($_POST['Clean']))
{
$result = mysql_query("UPDATE pm SET del='2' WHERE sendto = '".mysql_real_escape_string($name)."'")
or die(mysql_error());
echo "Your Inbox has been cleaned.";
} // if clean
////////////////////////////////////////// delete message ////////////////////////////////////
if (!empty($_GET['delete'])){
$result = mysql_query("UPDATE pm SET del='2' WHERE sendto = '".mysql_real_escape_string($name)."' and id='" .mysql_real_escape_string($_GET['delete']). "'")
or die(mysql_error());
}//if delete message
if(isset($_POST['Delete'])){
$id = $_POST['id'];
if(!empty($id)){
$delete = implode(",",$id);
$delete = explode(",",$delete);
for($a = 0; !empty($delete[$a]);$a++){
$result = mysql_query("UPDATE pm SET del='2' WHERE sendto = '".mysql_real_escape_string($name)."' and id='" .mysql_real_escape_string($delete[$a]). "'")
or die(mysql_error());
}
echo "all selected messaged have been deleted.";
}else{
echo "You didn't select any posts.";
}
}
?>