title: Javascript alert and php header
body: <p>I got a little problem. When I got my PHP script without header it's fine, I am getting javascript alert box. But when I use header before alert it's not working. It's redirecting me like it should, but it's not showing any box. Could someone help me?</p>
  
  <pre><code>if ( $pkt &lt; 1 OR $user_id == 0) {
      header("Location: http://dunno.com/file.php");
      $message = 'This is a message.';
  
  echo "&lt;SCRIPT&gt; //not showing me this
  alert('$message');
  &lt;/SCRIPT&gt;";
      mysql_close();
  }
  </code></pre>
  
  <p>And here's the one which work (but without heading)</p>
  
  <pre><code>if ( $pkt &lt; 1 OR $user_id == 0) {
      $message = 'This is a message.';
  
  echo "&lt;SCRIPT&gt; //showing me
  alert('$message');
  &lt;/SCRIPT&gt;";
      mysql_close();
  }
  </code></pre>
  
  <p>I would be thankful for help :)</p>
  
  <p>@edit Maybe is there any command to make alert wait until whole browser load? (if it's the problem)</p>