I don't understand what you mean by "terminate previous header halfway".
A header has either been sent or it has not. If you need to send one of two headers depending on some set circumstances, your code should check for those circumstances before sending headers.
Well, I need to design my own error handler function. Whenever error occur, I hope this function not only can keep the error log, but also direct user to another page.
I tried to put header() in this function, but in some cases, it popup the message saying the header already been sent.
function myErrHandler(...) {
...blah...
header("Location: error.html");
}
set_error_handler("myErrHandler");
I just wonder whether I can terminate the previous header and send another header to direct it to another page.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.