$("#forms1,#forms2").submit(function () {
$.ajax({
type: "GET",
url: "engine/modules/feedbackdm/res.php",
data: $(this).serialize()
}).done(function () {
alert("Спасибо за ваш ответ!");
$("#forms1,#forms2").modal('hide');
$('input').val('');
$('select').val('');
});
return false;
});
<?php
if( !defined('DATALIFEENGINE') OR !$config['allow_comments'] ) {
header( "HTTP/1.1 403 Forbidden" );
header ( 'Location: ../../' );
die( "Hacking attempt!" );
}
error_reporting(-1);
header('Content-Type: text/html; charset=utf-8');
define('send_email','admin@site.ru');
$recepient = send_email;
$sener = 'robot@site.ru';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/plain; charset=UTF-8' . "\r\n";
$headers .= "From: $sener \r\n";
$name = trim($_POST["name"]);
$phone = trim($_POST["phone"]);
$email = trim($_POST["email"]);
$select = trim($_POST["plan"]);
$id_form = trim($_POST["id_form"]);
$reviews = trim($_POST["message"]);
$ip = $_SERVER['REMOTE_ADDR'];
$dtofz = date("d.m.y");
$sitename = "(Дель-мара)";
$date = trim($_POST["date"]);
$people = trim($_POST["people"]);
$pagetitle = "Заявка с сайта! \"$sitename\" Заказ столика Удобное время:$vrema_zakaza";
$email = preg_replace("/ {1,}/", "_", $email);
$select = preg_replace("/ {1,}/", "_", $select);
$id_form = preg_replace("/ {1,}/", "_", $id_form);
$message = "\nИмя: $name \nТелефон: $phone \nДата: $date \nУдобное время: $vrema_zakaza \nКоличество гостей: $people \nEmail: $email \nформа $id_form \nIP:$ip ";
if (mail($recepient, $pagetitle, $message, $headers)) {
}
<form class="wrap-form-booking forms1" id="forms1" method="POST" />