Current Path : /home/c247essa/public_html/

Linux c22487.sgvps.net 3.12.18-clouder0 #1 SMP Tue Oct 9 18:14:47 EEST 2018 x86_64

Upload File :
Current File : /home/c247essa/public_html/ajax_actions2.php
<?php 
include 'backend.php';
page_protect();
$err = array();
$msg = array();

foreach($_GET as $key => $value) {
	$get[$key] = filter($value);
}
foreach($_POST as $key => $value) {
	$data[$key] = filter($value);
}

$the_msg = mysql_real_escape_string($get['the_reply_msg']);

if($get['cmd'] == 'reply_to_msg'){

//if(!empty($get['reply_msg'])) {

$sql_insert= "INSERT into `messages` 
			(`sender`, `to`, `msg_subject`, `message`, `order`, `date`,  `dpt_email`) VALUES ('$_SESSION[id]', '$get[to]', '$get[msg_subject]', '$the_msg','$get[order]', '".date("Y-m-d H:i:s")."' , '$get[dpt_email]')";
			mysql_query($sql_insert,$connect) or die("Insertion Failed:" . mysql_error());	
			
//Copy to message outbox
$sql_insert2= "INSERT into `messages_outbox` 
			(`sender`, `to`, `msg_subject`, `message`, `order`, `date`,  `dpt_email`) VALUES ('$_SESSION[id]', '$get[to]', '$get[msg_subject]', '$the_msg','$get[order]', '".date("Y-m-d H:i:s")."' , '$get[dpt_email]')";
			mysql_query($sql_insert2,$connect) or die("Insertion Failed:" . mysql_error());			

//email
$message_to_dep = 
'
<html>
<body>
<div style="padding:10px; line-height:22px; -moz-border-radius: 5px;-webkit-border-radius: 5px;	border-radius: 5px; color:#003366;  background:#e6efee; border:1px solid #c4de95; font-family: Corbel; font-size:14px;">

 '.$get['reply_msg'].'

<br><br>
<span style="color:#253350; font-weight:bold; font-size:15px;">
Regards,<br>
Support Department, <br>
<strong><i>'.SITE_HOST_NAME.' </i></strong><br>
Email: '.$site_email.'
</span>
</div>

</body>
</html>
';
// send it 
    $to = $get['dpt_email'];
    $from = "Message on order -  <$_SESSION[email]>";
    $subject = "Message from Writer on order: $get[order]"; 
    $headers  = "From: $from\r\n";
	$headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
	
    @mail($to, $subject, $message_to_dep, $headers.
    "X-Mailer: PHP/" . phpversion());
				
echo 'msg is '.$the_msg;
  //  } // empty errors

exit();
}
?>