HEX
Server: Apache/2.4.46 (Unix) PHP/7.4.24
System: Linux dc15-w.ht-systems.ru 2.6.32-042stab142.1 #1 SMP Tue Jan 28 23:44:17 MSK 2020 x86_64
User: srv52894 (52894)
PHP: 7.4.24
Disabled: passthru,shell_exec,system,proc_open,popen,show_source
Upload Files
File: /home/srv52894/zharparcom.ru/sendFormData.php
<?php
//E-mail для доставки заявок
$to = "info@zharparcom.ru, 89277567733@mail.ru";

$type = $_POST['form_type'];

if ($type == 'form_kupon') {
	$name = clean($_POST['name_title']);
	$phone = clean($_POST['phone_title']);
	$phone = clean($_POST['phone_title']);
	$phone = clean($_POST['phone_title']);
	$phone = clean($_POST['phone_title']);

	if (strlen($name) > 1 && strlen($phone) > 1) {
		$text = "
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Имя:</b> ".$name."</p>
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Телефон:</b> ".$phone."</p>
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Телефон:</b> ".$phone."</p>
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Телефон:</b> ".$phone."</p>
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Телефон:</b> ".$phone."</p>
		";

		send($to, "Новая заявка на получение купона!", $text);
	}
	else die("error!");
}
else if ($type == 'form_feedback') {
	$name = clean($_POST['name']);
	$phone = clean($_POST['phone']);



	if (strlen($phone) > 5) {
		$text = "
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Имя:</b> ".$name."</p>
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Телефон:</b> ".$phone."</p>			



		";

		send($to, "Заказали обратный звонок", $text);	
	}
	else {
		die("error!");
	}
}
else if ($type == 'form_feedbacks') {
	$name = clean($_POST['name']);
	$phone = clean($_POST['phone']);
	$email = clean($_POST['email']);
	$message = clean($_POST['message']);



	if (strlen($phone) > 5) {
		$text = "
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Имя:</b> ".$name."</p>
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Телефон:</b> ".$phone."</p>		
<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Email:</b> ".$email."</p>		
<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Сообщение:</b> ".$message."</p>					



		";

		send($to, "Есть вопрос", $text);	
	}
	else {
		die("error!");
	}
}



else if ($type == 'form_question') {
	$name = clean($_POST['name']);
	$phone = clean($_POST['phone']);


	if (strlen($name) > 2) {
		$text = "
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Имя:</b> ".$name."</p>
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Телефон:</b> ".$phone."</p>

		";

		send($to, "Заказ обратного звонка с сайта", $text);	
	}
	else {
		die("error!");
	}
}

else if ($type == 'form_appointment') {
	$name = clean($_POST['name']);
	$text = clean($_POST['text']);


	if (strlen($name) > 2) {
		$text = "
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Имя:</b> ".$name."</p>
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Куда писать:</b> ".$text."</p>

		";

		send($to, "С сайта письмо", $text);	
	}
	else {
		die("error!");
	}
}

else if ($type == 'form_phone') {
	$phone = clean($_POST['phone']);


	if (strlen($phone) > 2) {
		$text = "
			<p style=\"color:#000; font-size:14px; font-family:sans-serif, Arial, Verdana;\"><b>Телефон:</b> ".$phone."</p>

		";

		send($to, "Получиться бесплатную консультацию", $text);	
	}
	else {
		die("error!");
	}
}


else {
	echo 'error!';
}


function send ($to, $subject, $text) {
	$message = '
	<html>
	<head>
	  <title>'.$subject.'</title>
	</head>
	<body>
		<p style="color:#000; font-size:14px; font-weight:bold; font-family:sans-serif, Arial, Verdana;">'.$subject.'</p>
		' . $text . '
		<p style="color:gray; font-size:10px; font-family:sans-serif, Arial, Verdana;">Заявка получена '.date("d.m.y H:i:s").'</p>
	</body>
	</html>';


    $headers = 'From: info@' . $_SERVER['SERVER_NAME'] . "\r\n" ;
    $headers .='Reply-To: info@'. $_SERVER['SERVER_NAME'] . "\r\n" ;
    $headers .='X-Mailer: PHP/' . phpversion();
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=utf-8\r\n";  
	
	if(mail($to, $subject, $message, $headers)) {
		echo "success";
	}
}

function clean ($data) {
	return trim(strip_tags($data));
}
?>