Let's say that I want some generic error handling, which can be called from all over...
Ideally, I would like to just readirect to an error page using header('Location:...
but, of course I can't do that it if any output has been written, so ...
1) how can I detect if any output has been written?
2) how can I load a new page if it has?
Perhaps I should buffer the entire page and only output it once I am certain that it is complete and no more errors can occur?