title: No previous output,but header redirect doesn't work in PHP
body: <pre><code>header('Location: ' . $url);
  </code></pre>
  
  <p>I've checked that there is no previous output:</p>
  
  <pre><code>ob_start();
  
  ...
  var_dump(ob_get_contents());
  ob_flush();
  header('Location: ' . $url);
  </code></pre>
  
  <p>outputs:</p>
  
  <pre><code>string '' (length=0)
  </code></pre>
  
  <p>Then why does the redirect fail?</p>
  
  <p>Though I see lots of warnings and notices in the <code>error_log</code>,but that doesn't affect <code>header()</code> as long as it doesn't output anything to the browser,right?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Some logs(should not be related though):</p>
  
  <pre><code>[Wed May 19 00:26:10 2010] [error] [client 127.0.0.1] PHP Deprecated:  Function eregi() is deprecated in D:\\Works\\general
  [Wed May 19 00:26:10 2010] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/cookie_usage.php
  [Wed May 19 00:26:10 2010] [error] [client 127.0.0.1] PHP   1. {main}() D:\\Works\\login.php:0, referer: http://localhost/cookie_usage.php
  [Wed May 19 00:26:10 2010] [error] [client 127.0.0.1] PHP   2. tep_redirect() D:\\Works\\login.php:33, referer: http://localhost/cookie_usage.php
  </code></pre>