I'm glad you figured it out.
Originally Posted by mutago
If your question has been answered, please mark your thread "resolved":
- On your original post (post #1), click , then click [go advanced].
- In the "thread prefix" box, select "Resolved".
- Click [save changes].
Two things that might be helpful for you in the future:
1) The fact that you have to use output buffering means that you have output being sent to the browser before you try to use
header(). Using ob is just a monkeypatch (and will still fail if you ever happen to output more than 4096 bytes (your chunk size) before you try to set any headers). The real solution is to re-organize the order in which your script is written, so that all of your output happens after all of your program logic. Writing "PHP First" will also mitigate other problems in the future.
2) If you did not fix your Location header string, you should still do so. Not all browsers will interpret what you have the same way, and some will ignore it because it is not well-formed.
Your current example would be correctly written like so:
Originally Posted by http://php.net/header