Header already sent

August 11, 2008 · Filed Under PHP 

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’;
?>

If you enjoyed this post and found it useful, please write your comments. You comments would encourage us to write more. Also make sure you subscribe to our RSS feed!

We Provide Custom PHP Programming for Joomla , Wordpress, OScommerce, Creloaded, Xcart and any other opensource solution you can think of at www.technoIntellects.com.

Get our Joomla Hosting Packages at the affordable price with unlimited services

Comments

Leave a Reply