title: php code not executing after calling a javascript alert
body: <p>I'm having some troubles getting a php redirect to execute after a javascript alert is called. The code is below:</p>
  
  <pre><code>echo '&lt;script&gt;window.alert("This device is aleady registered to another user");&lt;/script&gt;';
  header('Location: page.php');
  </code></pre>
  
  <p>After clicking "OK" on the alert, the redirect does not execute. Any thoughts as to how I can get this code working?</p>
  
  <p>Thanks</p>