F
F
FIKSER2018-04-09 14:48:35
PHP
FIKSER, 2018-04-09 14:48:35

Why php contact form doesn't count values?

PHP

spoiler
<?php 
 
$sendto   = "[email protected]"; // Куда отправлять
$name = $_POST['imea'];
$messages = $_POST['soobwenie'];
$mail = $_POST['pocta'];
$tel = $_POST['mobil'];


// Тема сообщения
$subject  = "Новый заказ!";
$headers  = "From: " . strip_tags($usermail) . "\r\n";
$headers .= "Reply-To: ". strip_tags($usermail) . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8 \r\n";
 
// Структура сообщения
$msg  = "<html><body style='font-family:Arial,sans-serif;'>";
$msg .= "<h2 style='font-weight:bold;border-bottom:1px dotted #ccc;'>Новый заказ!</h2>\r\n";
$msg .= "<p><strong>ИМЯ:</strong> ".$name."</p>\r\n";
$msg .= "<p><strong>Почта :</strong> ".$mail."</p>\r\n";
$msg .= "<p><strong>Телефон :</strong> ".$tel."</p>\r\n";
$msg .= "<p><strong>Сообщение :</strong> ".$messages."</p>\r\n";
$msg .= "</body></html>";
 
// Результат отправки
if(@mail($sendto, $subject, $msg, $headers)) {
    header("Location: index.html");
} else {
    echo "<center><img src='images/ne-tpravleno.png'></center>";
}
 
?>

HTML
spoiler
<!-- Форма обратной связи в модальном окне -->
<div class="modal" id="feedbackFormModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="myModalLabel">Форма обратной связи</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
 
        <!-- Форма обратной связи -->
        <form id="feedbackForm" action="send.php" enctype="multipart/form-data" novalidate>
          <div class="form-row">
            <div class="col-sm-6">
              <!-- Имя пользователя -->
              <div class="form-group">
                <label for="name" class="control-label">Имя:</label>
                <input id="name" type="text" name="imea" class="form-control" value="" >
                
              </div>
            </div>
            <div class="col-sm-6">
              <!-- Email пользователя -->
              <div class="form-group">
                <label for="email" class="control-label">Email-адрес:</label>
                <input id="email" type="email" name="pocta"  class="form-control" value="" >
              </div>
            </div>
          </div>



 <!-- Телефон -->
          <div class="form-group">
             <label for="phone" class="control-label">Номер телефона:<span class="text-danger">*</span></label>
               <div class="input-group-prepend">
               	  <div class="input-group-text"></div>
               	</div>
               	<input type="tel" name="mobil"  id="phone" class="form-control" value=""> 
                
          </div>
      </div>

          <!-- Сообщение пользователя -->
          <div class="form-group">
            <label for="message" class="control-label">Сообщение:</label>
            <textarea id="message" name="soobwenie" class="form-control" rows="3" ></textarea>
          </div>
         
         
         
         
          <!-- Кнопка для отправки формы -->
          <button type="submit" class="btn btn-primary float-right" ">Отправить сообщение</button>
        </form>
                
        
      </div>
    </div>
  </div>
</div>

Messages are sent, but field values ​​are not counted. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman PHP, 2018-04-09
@FIKSER

that form has a default GET method?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question