If you're using header("Location: "); after you've output content make sure you've put ob_start(); earlier in the script. ob_start(); buffers your script, so nothing is output until you either call ob_end(); or the end of the file is reached. Calling header("Location: "); after content has already been output to the browser can cause problems.