L
L
lada952018-04-28 11:11:39
MODX
lada95, 2018-04-28 11:11:39

When submitting the form, the same page is loaded in its place, what could be the matter?

status-domostroenie.ru/kontaktyi.html5ae42cacae2d5179965708.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Volf, 2018-04-28
@Wolfnsex

When submitting the form, the same page is loaded in its place, what could be the matter?
The point may be in what action is specified for this form.

I
Ivan Ivanov, 2018-04-28
@ZZiliST

<form class="ajax_form" method="post" action="kontaktyi.html">

</form>

Pay attention to the action you have that when you click on the submit button, the same page is reloaded. Instead, the action must contain a php file in which the logic for processing the letter goes.
to be more precise, something like this
<form class="ajax_form" method="post" action="mail.php">

</form>

and this is how mail.php should look like
$mail = "Ваша почта"
$name = htmlspecialchars($_POST['feedback-name']);  // получаем имя пользователя
$mailUser = htmlspecialchars($_POST['feedback-email']);  // получаем email пользователя 
$massage = htmlspecialchars($_POST['feedback-message']); // получаем сообщение пользователя

mail($mail, "Письмо из формы 'Контакты'", "Пользователь с именем".$name."и почтовым ящиком".$mailUser."Прислал вам сообщение: ". $massage. "Не забудьте ему ответить!"); // отправляем письмо на ящик

It seems to be so ... if you didn’t mess up anything

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question