title: How do I "activate/trigger" a contact form script from my HTML?
body: <p>Alright so this site is 'done', but the contact form at the bottom doesn't work. 
  Success response on the front end, but no email is generated.
  It's Bootstrap so the legwork with this form was already done, yet I feel like theres some sort of connecting step that I'm missing. Still new to PHP/JS.</p>
  
  <p>Here's the site: <a href="http://www.phasehome.com" rel="nofollow">PhaseHome</a></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="row"&gt;
              &lt;div class="col-lg-12"&gt;
                  &lt;form name="sentMessage" form action="../mail/contact_me.php" method="post" id="contactForm" novalidate&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-6"&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;input type="text" class="form-control" placeholder="Your Name *" id="name" required data-validation-required-message="Please enter your name."&gt;
                                  &lt;p class="help-block text-danger"&gt;&lt;/p&gt;
                              &lt;/div&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;input type="email" class="form-control" placeholder="Your Email *" id="email" required data-validation-required-message="Please enter your email address."&gt;
                                  &lt;p class="help-block text-danger"&gt;&lt;/p&gt;
                              &lt;/div&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;input type="tel" class="form-control" placeholder="Your Phone *" id="phone" required data-validation-required-message="Please enter your phone number."&gt;
                                  &lt;p class="help-block text-danger"&gt;&lt;/p&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-6"&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;textarea class="form-control" placeholder="Your Message *" id="message" required data-validation-required-message="Please enter a message."&gt;&lt;/textarea&gt;
                                  &lt;p class="help-block text-danger"&gt;&lt;/p&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="clearfix"&gt;&lt;/div&gt;
                          &lt;div class="col-lg-12 text-center"&gt;
                              &lt;div id="success"&gt;&lt;/div&gt;
                              &lt;button type="submit" class="btn btn-xl"&gt;Submit&lt;/button&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>The following contact_me.php file is in a mail folder in the root directory (left the client email in so no one would think that was the missing link) --</p>
  
  <pre><code>    &lt;?php
  // Check for empty fields
  if(empty($_POST['name'])        ||
     empty($_POST['email'])       ||
     empty($_POST['phone'])       ||
     empty($_POST['message']) ||
     !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
     {
      echo "No arguments Provided!";
      return false;
     }
  
  $name = $_POST['name'];
  $email_address = $_POST['email'];
  $phone = $_POST['phone'];
  $message = $_POST['message'];
  
  // Create the email and send the message
  $to = 'steve@phasehome.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to.
  $email_subject = "www.phasehome.com Contact Form:  $name";
  $email_body = "Hello Steve. You have received a new submission from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n$message";
  $headers = "From: noreply@phasehome.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com.
  $headers .= "Reply-To: $email_address"; 
  mail($to,$email_subject,$email_body,$headers);
  return true;            
  ?&gt;
  </code></pre>
  
  <p>And finally, this <strong>contact_me.js</strong> was located in the js directory:</p>
  
  <pre><code>        $(function() {
  
      $("input,textarea").jqBootstrapValidation({
          preventSubmit: true,
          submitError: function($form, event, errors) {
              // additional error messages or events
          },
          submitSuccess: function($form, event) {
              event.preventDefault(); // prevent default submit behaviour
              // get values from FORM
              var name = $("input#name").val();
              var email = $("input#email").val();
              var phone = $("input#phone").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: "././mail/contact_me.php",
                  type: "POST",
                  data: {
                      name: name,
                      phone: phone,
                      email: email,
                      message: message
                  },
                  cache: false,
                  success: function() {
                      // Success message
                      $('#success').html("&lt;div class='alert alert-success'&gt;");
                      $('#success &gt; .alert-success').html("&lt;button type='button' class='close' data-dismiss='alert' aria-hidden='true'&gt;&amp;times;")
                          .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;');
  
                      //clear all fields
                      $('#contactForm').trigger("reset");
                  },
                  error: function() {
                      // Fail message
                      $('#success').html("&lt;div class='alert alert-danger'&gt;");
                      $('#success &gt; .alert-danger').html("&lt;button type='button' class='close' data-dismiss='alert' aria-hidden='true'&gt;&amp;times;")
                          .append("&lt;/button&gt;");
                      $('#success &gt; .alert-danger').append("&lt;strong&gt;Sorry " + firstName + ", it seems that my mail server is not responding. Please try again later!");
                      $('#success &gt; .alert-danger').append('&lt;/div&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>
  
  <p>Thanks for any help!</p>
  
  <p>UPDATE:
  Updated the HTML and JS, still no dice. Maybe I should mention, I just noticed this message in DreamWeaver on the <code>contact_me.php: "Dynamically-related files cannot be discovered because there is no site definition for this document"</code>  .. could that be the culprit?</p>
  
  <p>UPDATE 2:</p>
  
  <p>New contact_me.js in Dreamweaver is giving me a syntax error on line 29 ('cache false' just after your ajax suggestion).</p>
  
  <pre><code>    $(function() {
  
      $("input,textarea").jqBootstrapValidation({
          preventSubmit: true,
          submitError: function($form, event, errors) {
              // additional error messages or events
          },
          submitSuccess: function($form, event) {
              event.preventDefault(); // prevent default submit behaviour
              // get values from FORM
              var name = $("input#name").val();
              var email = $("input#email").val();
              var phone = $("input#phone").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: "public_html/mail/contact_me.php",
                          type: 'POST',
                          data: $('#contactForm').serialize(),
                      name: name,
                      phone: phone,
                      email: email,
                      message: message
                  },
                  cache: false,
                  success: function() {
                      // Success message
                      $('#success').html("&lt;div class='alert alert-success'&gt;");
                      $('#success &gt; .alert-success').html("&lt;button type='button' class='close' data-dismiss='alert' aria-hidden='true'&gt;&amp;times;")
                          .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;');
  
                      //clear all fields
                      $('#contactForm').trigger("reset");
                  },
                  error: function() {
                      // Fail message
                      $('#success').html("&lt;div class='alert alert-danger'&gt;");
                      $('#success &gt; .alert-danger').html("&lt;button type='button' class='close' data-dismiss='alert' aria-hidden='true'&gt;&amp;times;")
                          .append("&lt;/button&gt;");
                      $('#success &gt; .alert-danger').append("&lt;strong&gt;Sorry " + firstName + ", it seems that my mail server is not responding. Please try again later!");
                      $('#success &gt; .alert-danger').append('&lt;/div&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>