I have a script that has a call to header();
and its working fine for a couple of days since I first started running the script.
then after a couple of days, it started to have an error saying it cannot modify header information.
Then I put ob_start();
and ob_end_flush();
upon googling the error and it works!
The error has gone but my question is that why it works without ob_start();
and ob_end_flush();
for a couple of days before?
I want to know the explanation behind this behavior.
btw, I call header()
this way:
if(condition is true){
header('Location: anotherpage.php');
}
and I have a session_start();
at the beginning.