Header already sent

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  

Note that if you don't want to go through the process of making sure that there is no output before you send a header, you can use

<?php
ob_start
();
?>

at the beginning of your page.
This starts the output buffer, which allows you to send headers whenever you feel like it. Make sure that you put it at the BEGINNING, after the first php tag.

It allows you to do something like

<?php
ob_start
();
echo
'Hello';
header("Status: 404 Not Found");
echo
'Bye';
?>


Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply

Your email address will not be published. Required fields are marked *