I am new to this forum and have been reading all the posts.
Even though this is an old post I think it should be noted that the meta refresh as a redirect is not recommended by the W3C even though it is almost universally supported now.
Also the header (location) redirect must be processed before any output to the browser.