title: PHP automatically close window after timeout
body: <p>I was able to close the window.  But with the timeout, it does not seem to work.  </p>
  
  <p>This test.php was called by the submit button's action on another window.  If I remarked out all window closing script lines, then this "Sending ... This window will close itself after sending." will show up.  </p>
  
  <p>This <code>echo "&lt;script&gt;window.close();&lt;/script&gt;";</code> will close this window without showing any echo.  The other 3 lines, all I see is a blank window and not being closed at all.  Only on the Chrome I got a Server 500 error.  I tried on Firefox, Safari, and Chrome.</p>
  
  <p>Any suggestions?</p>
  
  <p>test.php contains:</p>
  
  <pre><code>&lt;?php
  
      echo "Sending ... This window will close itself after sending.";
  
      echo "&lt;script&gt;window.close();&lt;/script&gt;";  // this line works
  
  //    echo "&lt;script&gt;setTimeout("window.close()", 5000);&lt;/script&gt;";
  
  //    &lt;script type="text/javascript"&gt;setTimeout("window.close();", 3000);&lt;/script&gt;
  //    echo "&lt;script type="text/javascript"&gt;setTimeout( function() { window.close(); }, 3000);&lt;/script&gt;"
  
  ?&gt;
  </code></pre>