Files
TravianZ/Admin/Mods/sendMessage.php
T
2017-10-19 21:17:11 +02:00

31 lines
1.3 KiB
PHP

<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename sendMessage.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
#################################################################################
include_once("../../GameEngine/Account.php");
mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysqli_select_db(SQL_DB);
if (!isset($_SESSION)) session_start();
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
foreach ($_POST as $key => $value) {
$_POST[$key] = $database->escape($value);
}
$uid = (int) $_POST['uid'];
$topic = $_POST['topic'];
$message = $_POST['message'];
$time = time();
$query = "INSERT INTO ".TB_PREFIX."mdata (target, owner, topic, message, viewed, time) VALUES ('$uid', 1, '$topic', '$message', 0, '$time')";
mysqli_query($GLOBALS["link"], $query);
header("Location: ../../../Admin/admin.php?p=Newmessage&uid=".$uid."&msg=ok");
?>