I can not understand what the error is, the selected select value is not sent, tell experts, please.

<form action="/mail.php" method="post" onsubmit="return checkForm(this);"> Ваше имя:<br> <input type="text" name="name" size="50"> <br> Ваш E-mail:<br> <input name="email" type="text" size="50"> <br> Ваше сообщение:<br> <textarea name="mess" id="textarea" font="" rows="10" cols="50"></textarea> <p> Выбрать:<br> <select name="select"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <input type="submit" value="Отправить сообщение"> </p> </form> 

 <?php if (isset($_POST['name'])) {$name = $_POST['name'];} if (isset($_POST['email'])) {$email = $_POST['email'];} if (isset($_POST['mess'])) {$mess = $_POST['mess'];} if (isset($_POST['select'])) {$mess = $_POST['select'];} $to = "i@i.com"; $headers = "Content-type: text/plain; charset = UTF-8"; $subject = "Подписка"; $message = "Имя пославшего: $name \nЭлектронный адрес: $email \nСообщение: $mess \nТип: $select"; $send = mail ($to, $subject, $message, $headers); if ($send == 'true') { echo "<b>Спс!<p>"; } else { echo "<p><b>Ошибка"; } ?> 

  • On the php side, at the very beginning, do print_r ($ _ POST) and see what arrives to you. And show us - add a question with this data. - n.osennij
  • does not send. gives an error - ogd
  • what mistake? Get together, dear. - n.osennij
  • page unavailable error 500 request is not processed - ogd
  • Does php work for you at all? /mail.php file at the specified path /mail.php exist? Is the path correct? - n.osennij

1 answer 1

Be careful

 if (isset($_POST['name'])) {$name = $_POST['name'];} if (isset($_POST['email'])) {$email = $_POST['email'];} if (isset($_POST['mess'])) {$mess = $_POST['mess'];} if (isset($_POST['select'])) {$select = $_POST['select'];} $to = "i@i.com"; $headers = "Content-type: text/plain; charset = UTF-8"; $subject = "Подписка"; $message = "Имя пославшего: $name \nЭлектронный адрес: $email \nСообщение: $mess \nТип: $select"; $send = mail ($to, $subject, $message, $headers); if ($send == 'true') { echo "<b>Спс!<p>"; } else { echo "<p><b>Ошибка"; } 
  • damn, here I am .. thanks a lot !!! - ogd
  • yes, it works, thanks - ogd