Answer the question
In order to leave comments, you need to log in
How to connect a "callback" to the VI with your own code without a plugin?
welovepavel.esy.es
is the code for the JJ inserted into the outside page of the WP.
he addresses to push the handler, which is on the same server.
<div class="zvon">
<h3>Заказать звонок</h3>
<form id="form">
<input class="ip1" placeholder="Ваше имя" required="" name="name" type="text">
<input id="phone23" class="ip1" placeholder="Ваш телефон" required="" name="phone" type="text">
<input value="Отправить" onclick="" type="submit">
</form>
</div>
<script>
$(function() {
$("#form").submit(function(e) {
e.preventDefault();
if([].every.call($(".ip1"), function(e){ return e.value.length })){
$.ajax({
type: "POST",
url: "http://welovepavel.esy.es/wp-content/mail.php",
data: $(this).serialize()
}).done(function() {
$(this).find("input").val("");
swal("Спасибо за заявку!", "Мы скоро свяжемся с Вам.","success");
$("#form").trigger("reset");
});
}else{
swal("Ошибка", "Не заполнены все поля", "error");
}
});
$("#phone23").mask("+7 (999) 999-9999");
});
</script>
"> <?php
$recepient = "[email protected]";
$sitename = "Аренда техники заявка на звонок";
$name = trim($_POST["name"]);
$phone = trim($_POST["phone"]);
$text = trim($_POST["text"]);
$message = "Имя: $name \nТелефон: $phone \nТекст: $text";
$pagetitle = "Новая заявка с сайта \"$sitename\"";
mail($recepient, $pagetitle, $message, "Content-type: text/plain; charset=\"utf-8\"\n From: $recepient");
?>
Answer the question
In order to leave comments, you need to log in
Write technical specifications for the site right away, and we will write the whole code for you, which is already there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question