title: HTML Form not sending one parameter in POST request
body: <p>I have a form in my page, with 4 fields: name, email, purpose and comments. However, when I submit, the POST encoded request contains only three - name, email and comments.</p>
  
  <p>The purpose field is EXACTLY the same as Name, with the same attributes. This is really baffling. Anything I am doing wrong?</p>
  
  <pre><code>&lt;form method="post" action="http://myserver.com/contact.php" name="contactform" id="contactform" role="form"&gt;
  
                      &lt;fieldset id="contact_form"&gt;
                          &lt;label for="name"&gt;
                              &lt;input type="text" name="name" id="name" placeholder="Name" required /&gt;
                          &lt;/label&gt;
  
                          &lt;label for="email"&gt;
                              &lt;input type="email" name="email" id="email" placeholder="Email" required /&gt;
                          &lt;/label&gt;
  
                          &lt;label for="purpose"&gt;
                              &lt;input type="text" name="purpose" id="purpose" placeholder="Purpose" required /&gt;
                          &lt;/label&gt;
  
                          &lt;label for="comments"&gt;
                              &lt;textarea name="comments" id="comments" placeholder="Details"&gt;&lt;/textarea&gt;
                          &lt;/label&gt;
  
                          &lt;input type="submit" class="btn btn-black btn-default" id="submit" value="Submit" /&gt;
                      &lt;/fieldset&gt;
  
                  &lt;/form&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/KyKCc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KyKCc.png" alt="enter image description here"></a></p>
  
  <p>Here is the PHP</p>
  
  <pre><code>&lt;?php
  
  header('Access-Control-Allow-Origin: *');
  
  ini_set('display_errors', 1);
  ini_set('display_startup_errors', 1);
  error_reporting(E_ALL);
  
  require($_SERVER['DOCUMENT_ROOT']."/mail_support/class.phpmailer.php");
  
  $form_name = $_POST['name'];
  $form_email= $_POST['email'];
  $form_purpose= $_POST['purpose'];
  $form_comments= $_POST['comments'];
  
  $mail = new PHPMailer();
  
  $mail-&gt;IsSMTP();  // telling the class to use SMTP
  $mail-&gt;SMTPDebug = 3;
  $mail-&gt;Host     = "cp-dd-us-3.webhostbox.net"; // SMTP
  $mail-&gt;SMTPAuth = true;
  $mail-&gt;Username = "***@website.com";
  $mail-&gt;Password = "secret";
  $mail-&gt;SMTPSecure = "ssl";
  $mail-&gt;Port = 465;
  
  $mail-&gt;From     = "***@website.com";
  $mail-&gt;FromName = 'My Website';
  $mail-&gt;AddAddress("to_email","to_name");
  $mail-&gt;addReplyTo($form_email);
  
  $mail-&gt;isHTML(true);
  
  $mail-&gt;Subject = $form_name . "[" . $form_email . "]" . " for purpose" . $form_purpose;
  $mail-&gt;Body = "&lt;b&gt;" . $form_purpose . "&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;" . $form_comments ;
  $mail-&gt;AltBody = $form_purpose . "\n\n" . $form_comments;
  $mail-&gt;WordWrap = 50;
  
  if(!$mail-&gt;Send()) {
      echo 'Message was not sent.';
      echo 'Mailer error: ' . $mail-&gt;ErrorInfo;
  } else {
      echo 'Message has been sent.';
  }
  ?&gt;
  </code></pre>