escape($topic); $msgEsc = $database->escape($message); $time = time(); // --------------------------------------------------------------------------- // INSERT MESAJ (FULL FIX) // --------------------------------------------------------------------------- $sql = " INSERT INTO " . TB_PREFIX . "mdata ( target, owner, topic, message, viewed, archived, send, time, deltarget, delowner, alliance, player, coor, report ) VALUES ( $uid, $adminId, '$topicEsc', '$msgEsc', 0, 0, 0, $time, 0, 0, 0, 0, 0, 0 ) "; $result = $database->query($sql); if (!$result) { die("Message insert failed: " . $database->getError()); } // --------------------------------------------------------------------------- // LOG ADMIN ACTION // --------------------------------------------------------------------------- $logText = "Sent message to uid $uid: '$topicEsc'"; $logEsc = $database->escape($logText); $database->query(" INSERT INTO " . TB_PREFIX . "admin_log (`id`, `user`, `log`, `time`) VALUES (0, $adminId, '$logEsc', $time) "); // --------------------------------------------------------------------------- // REDIRECT SUCCESS // --------------------------------------------------------------------------- header("Location: ../../../Admin/admin.php?p=Newmessage&uid=" . $uid . "&msg=ok"); exit; ?>