-
Notifications
You must be signed in to change notification settings - Fork 1
/
takecontact.php
39 lines (27 loc) · 871 Bytes
/
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
<?php
require "include/bittorrent.php";
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] != "POST")
stderr("Error", "Method");
dbconn();
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);
mysql_query("INSERT INTO staffmessages (sender, added, msg, subject) VALUES($userid, $added, $message, $subject)") or sqlerr(__FILE__, __LINE__);
if ($_POST["returnto"])
{
header("Location: " . $_POST["returnto"]);
die;
}
stdhead();
stdmsg("Succeeded", "Message was succesfully sent!");
stdfoot();
exit;
?>