title: open bootstrap modal after php form submit
body: <p>I'm trying to submit my contact form, send the data in an email with PHP, stay on index.html and open a bootstrap modal with a "Thank you" message.</p>
  
  <p>All the other examples I've seen that might do this have used AJAX. 
  BUT I'd like to do it through PHP alone as my AJAX knowledge is non existent. Does anyone know if its even possible? and if so, how?</p>
  
  <p>I've only included the last part that makes sure I return to index.html or displays the errors from the form submission
  </p>
  
  <p>PHP from contact.php.</p>
  
  <pre><code>if(!$mail-&gt;Send()){
      echo "Message could not be sent.";
      echo "Mailer Error: " . $mail-&gt;ErrorInfo;
      exit;
  }
  print '&lt;meta http-equiv="refresh" content="0; url=index.html" /&gt;';
  echo "&lt;script&gt;$('#myModal').modal('show')&lt;/script&gt;";
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;form id='contactus' action='contact.php' enctype="multipart/form-data" method='post'&gt;
  &lt;fieldset&gt;
  &lt;legend&gt;Contact us&lt;/legend&gt;
  &lt;div class='container'&gt;  
      &lt;label for='email' &gt;Name*:&lt;/label&gt;&lt;br/&gt;
      &lt;input type="text" id="name" name="name" required /&gt;&lt;br&gt;
      &lt;label for='email' &gt;Phone*:&lt;/label&gt;&lt;br/&gt;
      &lt;input type="text" id="phone" name="phone" required /&gt;&lt;br&gt;
      &lt;label for='email' &gt;Email*:&lt;/label&gt;&lt;br/&gt;
      &lt;input type='text' name='email' id='email' required/&gt;&lt;br/&gt;
      &lt;label for='message' &gt;Message:&lt;/label&gt;&lt;br/&gt;
      &lt;textarea rows="10" cols="50" name='message' id='message'&gt;&lt;/textarea&gt;
          &lt;!-- MAX_FILE_SIZE must precede the file input field --&gt;
      &lt;br&gt;
      &lt;!-- Name of input element determines name in $_FILES array --&gt;
      Send this file: &lt;input id="file" name="image" type="file" /&gt;
      &lt;input type='submit' name='Submit' value='Submit' /&gt;
  &lt;/div&gt;
  &lt;div id="myModal" class="modal fade" role="dialog"&gt;
    &lt;div class="modal-dialog"&gt;
  
      &lt;!-- Modal content--&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
          &lt;h4 class="modal-title"&gt;Thanks!&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;p&gt;Thank you for your message!&lt;/p&gt;
        &lt;/div&gt;
        &lt;div class="modal-footer"&gt;
          &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>