title: Showing a Bootstrap modal after form is submitted
body: <p>I want to display a "thank you" modal when the page is reloaded after successful form submission.</p>
  
  <p>Here's my PHP at the bottom of the <code>&lt;head&gt;</code>:</p>
  
  <pre><code>&lt;?php
      if (isset($_POST["email"]) &amp;&amp; !empty($_POST["email"]))
      {
          $response_text = "Thanks, we'll be in touch soon!";
          include('connect.php');
          mysqli_query($con, "INSERT INTO sh_betalist (email, ip_address, signup_loc) VALUES ('" . $_POST['email'] . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . "homepage')");
          ?&gt;
          &lt;script type="text/javascript"&gt; $('#thankyouModal').modal('show'); &lt;/script&gt;
          &lt;?php
      }
  ?&gt;
  </code></pre>
  
  <p>That all works fine except for showing the modal, which doesn't happen. I don't get any errors in the JS console.</p>
  
  <p>Here's my modal at the bottom of the <code>&lt;body&gt;</code>:</p>
  
  <pre><code>&lt;div class="modal fade" id="thankyouModal" tabindex="-1" role="dialog" aria-labelledby="thankyouLabel" aria-hidden="true"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                  &lt;h4 class="modal-title" id="myModalLabel"&gt;Thank you for pre-registering!&lt;/h4&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  &lt;p&gt;You'll be the first to know when Shopaholic launches.&lt;/p&gt;                     
                  &lt;p&gt;In the meantime, any &lt;a href="http://shopaholic.uservoice.com/" target="_blank"&gt;feedback&lt;/a&gt; would be much appreciated.&lt;/p&gt;
              &lt;/div&gt;    
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>