Good day!
Please help! No phone number or email address is sent. The letter has an empty field. What can be and how to fix it? At what the name is sent to the mail correctly.

/* Здесь проверяется существование переменных */ if (isset($_POST['phone'])) {$phone=$_POST['phone'];} if (isset($_POST['name'])) {$name=$_POST['name'];} if (isset($_POST['addres'])) {$addres=$_POST['addres'];} /* Сюда впишите свою эл. почту */ $address = "s@yandex.ru"; /* А здесь прописывается текст сообщения, \n - перенос строки */ $mes = "Тема: Заказ обратного звонка! \nТелефон: $phone\nИмя: $name\nE-mail: $addres"; /* А эта функция как раз занимается отправкой письма на указанный вами email */ $sub='Заказ'; //сабж $email='Заказ <bigbur.ru>'; // от кого $send = mail ($address,$sub,$mes,"Content-type:text/plain; charset = utf-8\r\nFrom:$email"); ini_set('short_open_tag', 'On'); header('Refresh: 3; URL=index1.html'); 
  • What happens if the addres and phone elements are not in the POST array? - etki
  • and I will answer myself: because the phone is in the form of a roll in the adress field (and addres is used), and the phone field is not in sight. - etki
  • Honestly, I'm not friends with PHP! - Grosso2020
  • @ Grosso2020, I can occasionally recommend hiring a programmer. - etki
  • Hire a programmer to solve such a problem? easier to ask a question all the same - Grosso2020

0