title: Reloading a page won't work after calling a javaScript alert in PHP
body: <p>I have a <code>contact-us</code> page in my site. 
  When user submits a form it will go to  <code>mailIt.php</code> and do the necessary to send that mail. After sending that it will refresh the code. </p>
  
  <p>Since I wanted to add notification kinda thing to notify the user that the mail has been sent, I changed the code to display a javaScript alert in the page. But after that alert will be shown and the <strong>page loading will stop</strong> and it will remain in the <code>mailIt.php</code> page (with <code>inout</code> text).</p>
  
  <pre><code>@mail($email_to, $email_subject, $email_message, $headers);
  ?&gt;
      &lt;script type="text/javascript"&gt;
          alert("Thank you for contacting us!");
      &lt;/script&gt;
  &lt;?php
  echo("in");
  header('Location: /contact_us.html');   
  echo("out");
  </code></pre>
  
  <p>The only part I added is  the,</p>
  
  <pre><code>?&gt;
      &lt;script type="text/javascript"&gt;
          alert("Thank you for contacting us. We will be in touch with you very soon !");
      &lt;/script&gt;
  &lt;?php
  </code></pre>
  
  <p>Why is this happening ? How can I prevent that ?</p>