forked from jadz/php-sploits
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessages.php
More file actions
26 lines (24 loc) · 779 Bytes
/
messages.php
File metadata and controls
26 lines (24 loc) · 779 Bytes
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
<?php
require_once 'common.php';
require_once 'dbfuncs.php';
if(!empty($_SESSION['authed']) && $_SESSION['authed'] === true) {
if(!empty($_SESSION['userid'])) {
$msgSQL = "select * from messages where user_id = " .
$_SESSION['userid'];
$messages = getSelect($msgSQL);
echo "<p>Here are messages people have sent you!</p>";
echo "<table width='50%'>";
echo "<tr><td>Subject</td><td>Message</td>";
if(!empty($messages) && is_array($messages)) {
foreach($messages as $message) {
echo "<tr><td>" . $message[2] . "</td><td>" . $message[3] .
"</td></tr>";
}
}
echo "</table>";
}
}
else {
header('location: /login.php');
die;
}