so you have the file setup something like
require("whateverfilethisis.php");
header("Location: gotnextpage.php");
if this is the case then those <pre> </pre> tags should be the first to go. Next, take out all spaces and comments out of that code above. Then make sure all white space above <?php and below ?> is gone. Also make sure there are no command charters or something. If you read the PHP manual on header() you will find that there can be no spaces between code and that your problem is very common one:
Quoted from manual:
Remember that the header() function must be called before any actual output is sent, either by HTML tags blank lines in a file, or from PHP. It is a very common error to read code with include(), or
require(), functions, or another file access function, and have spaces or empty lines that will output before
header() is called. The same problem exists when using a single PHP/HTML file.
end quote.
That should work.