Initial commit
[2ch-be.git] / dev-test / old_dev / bak / messaging / msg.php
blob74c37dee52549ee515b1a4902dbaa1b2a8f3729a
1 <?php
3 if (!isset($_COOKIE['DMDM']) && !isset($_COOKIE['MDMD'])) {
4 header('location:index.php');
5 exit;
7 include('../encrypt.php');
9 $id = strip_tags(addslashes(trim($_POST['zxcvbnm'])));
10 $subj = strip_tags(addslashes(trim($_POST['subj'])));
11 $inf = strip_tags(addslashes(trim($_POST['msg'])));
13 $message = new Message;
14 $sanitize = $message->BeSanitize($inf);
15 if ($sanitize<>false) {
16 $user = $message->FindUser($id,$id_mail_path);
17 $sender = $message->GetID($_COOKIE['DMDM'],$id_mail_path);
18 $write = $message->WriteMDB($user,$sanitize,$sender,$subj,$id);
20 if ($write) {
21 echo "Message Sent";
22 } else {
23 echo "Error, please try again later";
25 } else {
26 echo "Content too long!";