-
Notifications
You must be signed in to change notification settings - Fork 2
/
takecontact.php
45 lines (32 loc) · 1.14 KB
/
takecontact.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
44
45
<?php
require "include/bittorrent.php";
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] != "POST")
stderr("Error", "Method");
loggedinorreturn();
$msg = trim($_POST["msg"]);
$subject = trim($_POST["subject"]);
if (!$msg)
stderr("Error","Please enter something!");
if (!$subject)
stderr("Error","You need to define subject!");
$added = "'" . get_date_time() . "'";
$userid = $CURUSER['id'];
$message = sqlesc($msg);
$subject = sqlesc($subject);
// Anti Flood Code
// This code ensures that a member can only send one PM per minute.
global $___flood___,$usergroups;
$___flood___->protect('last_staffmsg','PM to STAFF',$usergroups['antifloodtime'],1);
sql_query("INSERT INTO staffmessages (sender, added, msg, subject) VALUES($userid, $added, $message, $subject)") or sqlerr(__FILE__, __LINE__);
// Update Last PM sent...
$___flood___->update('last_staffmsg');
if ($_POST["returnto"])
{
header("Location: " . htmlentities($_POST["returnto"]));
die;
}
stdhead();
stdmsg("Succeeded", "Message was succesfully sent!");
stdfoot();
exit;
?>