How to enable the display of all php errors?

Friends, tell me how to enable the display of all php errors?
If possible, chew "for those who in the tank".
For tried in mail.php in the beginning of the file place this code? which is found here: Why PHP shows no errors?
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);

$frm_name = "Youname";
$recepient = "boulingist81@yandex.ru";
$sitename =". SK Ural";
$subject = "New request from the site \"$sitename\"";

$name = trim($_POST["name"]);
$customer_phone = trim($_POST["customer_phone"]);
$formname = trim($_POST["formname"]);

$message = "
Form: $formname <br-->
Name: $name <br>
Phone: $customer_phone
";

//$name2 = trim($_POST["name2"]);
$customer_phone2 = trim($_POST["customer_phone2"]);
$formname2 = trim($_POST["formname2"]);

$message = "
Form: $formname2 <br>
Name: $name2 <br>
Phone: $customer_phone2
";

//$name = trim($_POST["name3"]);
$customer_phone = trim($_POST["customer_phone"]);
$formname = trim($_POST["formname"]);

$message = "
Form: $formname <br>
Name: $name <br>
Phone: $customer_phone
";

mail($recepient, $subject, $message, "From: $frm_name <$email>" . "\r\n" . "Reply-To: $email" . "\r\n" . "X-Mailer: PHP/" . phpversion() . "\r\n" . "Content-type: text/html; charset=\"utf-8\"");

?>

No difference was not seen... it's either, I have everything OK or am I doing something really wrong...
Here is a link to a website that torment : mikhai3o.bget.ru
July 12th 19 at 17:25
2 answers
July 12th 19 at 17:27
Solution
Why there must be some mistakes? ;-)
In the mode of psychic I can assume that the mail does not reach - this may be due to a million reasons such as setting up mail on the local server.
The best solution is to take an existing library to work with mail, for example swiftmailer to send mail via smtp
Dmitry, you have telepathic powers on top! :) The problem is really with mail. Namely that I don't know how to write code that would come in the mail filled with messages from all three forms.
Now triggers only one form of this:
$name = trim($_POST["name"]);
$customer_phone = trim($_POST["customer_phone"]);
$formname = trim($_POST["formname"]);

$message = "
Form: $formname <br>
Name: $name <br>
Phone: $customer_phone
";

The rest come empty. That's why I wanted to see if there's an error somewhere (although most likely it is because I am not good at php) - briana.Strei commented on July 12th 19 at 17:30
:
1) No offense, learn how to formulate normal questions. If the problem is that in the "form fields do not reach" - and to write. What does the error output then.
2) If You think that something somewhere is not working as it should, use var_dump in a suspicious place and see what in a variable. Didn't understand what the problem is - move var_dump line by line up until you understand.
3) In Your specific case, at 15, 25 and 35 lines, the variable $message is overwritten.
The letter itself is sent only 1 time for 41 line, respectively it gets what was recorded in the $message for the last time. - margarete_Ferry commented on July 12th 19 at 17:33
: No problem, I understand everything!
How am I supposed to do in each variable $message, got the right data? To register $message1, $message2, etc.? I have no thoughts. - briana.Strei commented on July 12th 19 at 17:36
: what do you want to get in the end? 3 letters? 1 letter in which all the data? - margarete_Ferry commented on July 12th 19 at 17:39
:
The bottom line is this:
On the website there are buttons causing the feedback form.
Each form has its own name.
When filling out the form, I wish that would have came to one letter with the data the user entered ( name, phone), and the name of the form where the user entered data that would be aligned to the machine.
That is, for each shape a letter in the mail, which has all the data: Name the form, Name, Phone.
Now works correctly only the first form

$name = trim($_POST["name"]);
$customer_phone = trim($_POST["customer_phone"]);
$formname = trim($_POST["formname"]);

$message = "
Form: $formname <br>
Name: $name <br>
Phone: $customer_phone
";

Please do not scold severely, but are unable to formulate concisely. - briana.Strei commented on July 12th 19 at 17:42
:
1) all of this code erase nafig, leave 1 copy
2) in all forms in all the fields the same name + add input type hidden with the text over the form, and give it in the letter. - margarete_Ferry commented on July 12th 19 at 17:45
Hallelujah!!! Dmitry, thank you very much!!!! - briana.Strei commented on July 12th 19 at 17:48
: Worked!!!! - briana.Strei commented on July 12th 19 at 17:51
July 12th 19 at 17:29
Errors of logic, alas, not so easy to calculate.
But surely there are ways... If the opportunity is there you tell.
Thank you. - briana.Strei commented on July 12th 19 at 17:32
: They are called modular testing (e.g. UnitTest), but judging by the code You this is still far away. - margarete_Ferry commented on July 12th 19 at 17:35
: Maybe... I do not Have all of the forms come filled letters, and how to understand what and where to look and edit, I'll never know... So thought through mistakes to look... - briana.Strei commented on July 12th 19 at 17:38

Find more questions by tags PHP