F
F
FIKSER2017-07-17 16:05:38
PHP
FIKSER, 2017-07-17 16:05:38

Why does not open a message from the feedback form?

Does not display the result name="text", the rest is displayed correctly only with the encoding problem, the Russian language does not output.
What could be the problem?
index.html

<form action="form-handler.php" method="POST" name="form1">
                                <input type="text" name="name" placeholder="Ваше имя"/>
                                <input type="text" name="mail" placeholder="Ваш email"/>
                                <input type="text" name="text" placeholder="Сообщение"/>
                                <input type="submit" value="Отправить"/>
                            </form>

form-handler.php
<?php

$result = mail("[email protected]","Новая заявка","С сайта была получена заявка с такими данными: \nИмя: $_POST[name] \nПочта: $_POST[mail] \nСообщение: $_POST[text]");
if ($result) {
echo "<p> —Cообщение отправленно успешно!</p>";
}
 else {
   echo "<p> —Cообщение не отправленно !</p>"; 
 } 
?>

Result:
X-Sendmail-Cmdline: sendmail.pl -t -i
To: [email protected]
Subject: Новая заявка
X-PHP-Originating-Script: 0:form-handler.php


С сайта была получена заявка с такими данными: 
Имя: Name 
Почта: [email protected] 
Сообщение:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2017-07-17
@FIKSER

We looked at the code of his solution with the author.
When sending the form with ajax, the text itself was not transmitted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question