forked from salvozappa/fakebook
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsend-message.php
More file actions
41 lines (34 loc) · 891 Bytes
/
send-message.php
File metadata and controls
41 lines (34 loc) · 891 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require_once 'config.php';
require_once 'php/Fakebook.php';
$fakebook = new Fakebook();
if (isset($_POST['message'])) {
$message = $_POST['message'];
$to = $_POST['to'];
$fakebook->sendMessage($to, $message);
$fakebook->ok(5);
return;
}
if (!isset($_GET['to'])) {
$fakebook->error(4);
}
$uid = $_GET['to'];
?>
<!DOCTYPE html>
<html lang="en">
<?php include 'head.inc.php'; ?>
<body>
<?php include 'topbar.inc.php'; ?>
<div id="container">
<?php include 'sidebar.inc.php' ?>
<section id="content">
<h1 style="margin-top: 0;">Send a message to <a href="user.php?id=<?= $uid ?>"><?= $fakebook->getFullName($uid) ?></a>:</h1>
<form method="post" action="send-message.php">
<input type="hidden" name="to" value="<?= $uid ?>">
<textarea name="message" rows="4" cols="50"></textarea>
<input type="submit">
</form>
</section>
</div>
</body>
</html>