mmm, the delimiter between a HTTP header and the HTTP response is two line returns (one empty line). you can put aload of stuff before a header, but not an empty line... lol.. PHP tries to handle this automatically (in true CGI you have to send a content-type/location/[some other headers work], otherwise the request fails, if you use echo before you set a header, PHP sends a text/html content-type.)
So, as said, put header() before you do anything that could produce output.
The Location header is a request-level redirect (meaning a page that sends the Location header is never shown); so if you actually want to show something on the page during the redirect, maybe the Redirect header is more appropriate.
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64