Answer the question
In order to leave comments, you need to log in
Why is the content of the form not being sent to modx?
Need help with modx. Designed the site and made a feedback form. For some reason, from static pages (html-ok), the content of the forms was sent, but in the integrated layout - no. Where to dig?
here is ajax
$('.c-feedback-form__footer .e-btn').on('click', function(){
var form = $(this).closest('form');
var data = {
name: form.find("input[name='name']").val(),
email: form.find("input[name='email']").val(),
message: form.find("textarea[name='message']").val()
};
$.ajax({
type: "POST",
url: "mail.php",
data: data,
success: function() {
$(document).find('.iziModal-button.iziModal-button-close').trigger('click');
}
});
return false;
});
<?php
$mailto = '[email protected]';
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$theme = "Заявка от $name";
$headers = "Content-type: text/plain; charset=UTF-8\r\n";
$contactMessage = "Поступил новое предложение по почте.
Имя: $name
Почта: $email
Сообщение (если указано): $message";
mail($mailto, $theme, $contactMessage, $headers);
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question