Файл: modules/contakt/send.php
Строк: 82
<?php
########################################
## WAP-ENGINE ##
########################################
## ##
## Автор : CHUMA (Токарев Владимир) ##
## e-mail : crazychuma@gmail.com ##
## WAP : http://wap-engine.ru ##
## ##
########################################
## ВЫ НЕ ИМЕЕТЕ ПРАВО ##
## ИЗМЕНЯТЬ КОД СКРИПТА ##
## ДЛЯ ДАЛЬНЕЙШЕГО РАСПРОСТРАНЕНИЯ! ##
########################################
include ('../../config.php');
include ('../../templates/run.php');
include ('../../templates/func.php');
####################
if(isset($_SESSION['pass']) && isset($passw) && $_SESSION['pass'] == $passw)
{
$name = $login;
}
else
{
$gost = 'Гость';
$name = filter($_POST['name']);
$email = filter($_POST['email']);
}
$msg = filter($_POST['msg']);
if (empty($email))
{
$email = $emailadmina;
}
####################
$banlist = file('../../data/ban.txt');
$ip = getenv("REMOTE_ADDR");
$user_agent = getenv("HTTP_USER_AGENT");
$brauzer = strtok($user_agent," ");
$brauzer = filter($brauzer);
$ban = "$brauzer||$ip";
foreach ($banlist as $key => $string)
{
if($ban == trim(array_shift($banlist)))
{
$errb = 1;
}
}
$date_now = date ("YmdHis", time() + ($sdvigclock*3600));
if($bantime > $date_now)
{
$errb = 2;
}
####################
if(empty($name))
{
header("Location: index.php?err=1");
}
elseif(empty($msg))
{
header("Location: index.php?err=2");
}
elseif($gost=="Гость" && empty($_POST['imgrand']))
{
header("Location: index.php?err=3");
}
elseif($gost=="Гость" && $_POST['imgrand']!="$_SESSION[rand]")
{
header("Location: index.php?err=4");
}
elseif($gost=="Гость" && $errb == 1)
{
header("Location: index.php?err=5");
}
elseif($errb == 2)
{
header("Location: index.php?err=6");
}
elseif(isset($gost) && $dostup_mailadm == "0")
{
header("Location: index.php?err=7");
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$date = date("d-m-Y");
$time = date("H:i:s", time());
$subject = "Письмо с сайта $home";
$msg = str_replace('n', '<br />', $msg);
$mail = "Письмо от $gost $name nE-MAIL: $email nIp: $ip nБраузер: $agent nОтправлено: $date ($time) nnСообщение: n$msg";
$headers = "From: "".$name."" <".$email.">n";
$headers .= "X-sender: "".$name."" <".$email.">n";
$headers .= "Content-Type: text/plain; charset=utf-8n";
$headers .= "MIME-Version: 1.0rn";
$headers .= "Content-Transfer-Encoding: 8bitrn";
$headers .= "X-Mailer: PHP v.".phpversion();
mail($emailadmina, $subject, $mail, $headers);
header("Location: index.php?mailing=1&".session_name()."=".session_id()."");
}
?>