title: Add a field to PHP form
body: <p>I'm new to PHP; integrating this form <a href="http://myprogrammingblog.com/2013/08/27/how-to-make-a-contact-form-with-bootstrap-3-jqueryphphtml5jqbootstrapvalidation/" rel="nofollow">http://myprogrammingblog.com/2013/08/27/how-to-make-a-contact-form-with-bootstrap-3-jqueryphphtml5jqbootstrapvalidation/</a> into my Bootstrap page. Works great, but I'm trying to figure out how to add one more field called "Organization" to the form (one the PHP side, obviously; I understand how to add the input to the form). Can anyone help me out? </p>
  
  <p>EDIT: I gathered from comments on the tutorial that I need to do the following:
  1. Add an input to the form itself
  2. add the new var to the JS validation
  3. In PHP catch client input and add variables where save client input into mail function</p>
  
  <p>I tried to do this, but the form's now not sending the info.</p>
  
  <pre><code>&lt;form class="well" id="contactForm" name="sentMessage" novalidate=""&gt;Contact me
         &lt;!-- Full Name --&gt;
  &lt;div class="control-group"&gt;
  &lt;div class="controls"&gt;
          &lt;input class="form-control" id="name" type="text" placeholder="Full Name" required="" data-validation-required-message="Please enter your name" /&gt;
  
  &lt;/div&gt;
  &lt;/div&gt;
          &lt;!-- Email --&gt;
  &lt;div class="control-group"&gt;
  &lt;div class="controls"&gt;
          &lt;input class="form-control" id="email" type="email" placeholder="Email" required="" data-validation-required-message="Please enter your email" /&gt;&lt;/div&gt;
  &lt;/div&gt;
          &lt;!--Message --&gt;
  &lt;div class="control-group"&gt;
  &lt;div class="controls"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="success"&gt;&lt;/div&gt;
   &lt;!-- For success/fail messages --&gt;
   &lt;button class="btn btn-primary pull-right" type="submit"&gt;Send&lt;/button&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>/*
    Jquery Validation using jqBootstrapValidation
     example is taken from jqBootstrapValidation docs
    */
  $(function() {
  
   $("input,textarea").jqBootstrapValidation(
      {
       preventSubmit: true,
       submitError: function($form, event, errors) {
        // something to have when submit produces an error ?
        // Not decided if I need it yet
       },
       submitSuccess: function($form, event) {
        event.preventDefault(); // prevent default submit haviour
         // get values from FORM
         var name = $("input#name").val();
         var email = $("input#email").val();
         var message = $("textarea#message").val();
          var firstName = name; // For Success/Failure Message
             // Check for white space in name for Success/Fail message
          if (firstName.indexOf(' ') &gt;= 0) {
         firstName = name.split(' ').slice(0, -1).join(' ');
           }
       $.ajax({
                  url: "./bin/contact_me.php",
                  type: "POST",
                  data: {name: name, email: email, message: message},
                  cache: false,
                  success: function() {
                  // Success message
                     $('#success').html("&lt;/pre&gt;
  &lt;div class="alert alert-success"&gt;");
   $('#success &gt; .alert-success').html("&lt;button class="close" type="button" data-dismiss="alert"&gt;×")
   .append( "&lt;/button&gt;");
   $('#success &gt; .alert-success')
   .append("&lt;strong&gt;Your message has been sent. &lt;/strong&gt;");
   $('#success &gt; .alert-success')
   .append('&lt;/div&gt;
  &lt;pre&gt;
  ');
  
            //clear all fields
            $('#contactForm').trigger("reset");
            },
         error: function() {
          // Fail message
           $('#success').html("&lt;/pre&gt;
  &lt;div class="alert alert-danger"&gt;");
   $('#success &gt; .alert-danger').html("&lt;button class="close" type="button" data-dismiss="alert"&gt;×")
   .append( "&lt;/button&gt;");
   $('#success &gt; .alert-danger').append("&lt;strong&gt;Sorry "+firstName+" it seems that my mail server is not responding...&lt;/strong&gt; Could you please email me directly to &lt;a href="'mailto:me@example.com?Subject=Message_Me"&gt;me@example.com&lt;/a&gt; ? Sorry for the inconvenience!");
   $('#success &gt; .alert-danger').append('&lt;/div&gt;
  &lt;pre&gt;
  ');
          //clear all fields
          $('#contactForm').trigger("reset");
          },
             })
           },
           filter: function() {
                     return $(this).is(":visible");
           },
         });
  
        $("a[data-toggle=\"tab\"]").click(function(e) {
                      e.preventDefault();
                      $(this).tab("show");
          });
    });
  
  /*When clicking on Full hide fail/success boxes */
  $('#name').focus(function() {
       $('#success').html('');
    });
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;?php 
  // check if fields passed are empty 
  
   if(empty($_POST['name'])   ||    
      empty($_POST['email'])  ||
      empty($_POST['message'])||   
      !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))    
    {     
         echo "No arguments Provided!";   return false;    
    } 
  
    $name = $_POST['name']; 
    $email_address = $_POST['email']; 
    $message = $_POST['message'];      
  
   // create email body and send it    
   $to = 'me@myprogrammingblog.com'; 
   // put your email 
   $email_subject = "Contact form submitted by:  $name"; $email_body = "You have received a new message. \n\n".                 
                     " Here are the details:\n \nName: $name \n ".                  
                     "Email: $email_address\n Message \n $message"; 
   $headers = "From: contacts@myprogrammingblog.com\n"; 
   $headers .= "Reply-To: $email_address";     
  
   mail($to,$email_subject,$email_body,$headers); return true;             
  ?&gt;
  </code></pre>