-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewmessage.php
42 lines (36 loc) · 1.37 KB
/
newmessage.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
<?php
$inbox = 1;
require "connect.php";
if (isset($_GET["reply"])) {
$message_id=$_GET["msg"];
$userfinal=$_SESSION['username'];
$message = mysql_query("SELECT * FROM `messages` WHERE `message_id` = '$message_id' AND `to_user` = '$userfinal'");
$message=mysql_fetch_assoc($message);
$posted = date("jS M Y h:i",$message["action"]);
$to = $message["from_user"];
$title = "RE: " . $message["message_title"];
} else {
$to = "";
$title = "";
}
include "template/header.php";
$userfinal=$_SESSION['username'];
$user=$userfinal;
if (!is_authed()) {
echo 'You must be logged in to view this page, <a href="login.php">click here</a> to login.';
echo '<br><br>';
include 'template/footer.php';
exit;
}
?>
<table>
<form name="message" action="newmessage2.php" method="post">
<tr><td>Title: </td><td><input type="text" name="message_title" id="message_title" value = "<?php echo $title; ?>"></td></tr>
<tr><td>To: </td><td><input type="text" name="message_to" id="message_to" value="<?php echo $to; ?>"></td></tr></table>
<tr><td>Message: <br></td></tr><textarea rows="20" cols="50" name="message_content" id="message_content"></textarea>
<input type="hidden" name="message_from" id="message_from" value="<?php echo $_SESSION['username']; ?>">
<br><input type="submit" value="Submit">
</form>
<?php
include "template/footer.php";
?>