Suppress those warning and errors!
Version: 11.1
Revision: 23.3 Build 6
Suppress those warning and errors!
Introduction: This problem is getting on my nerves and I don’t really like it! It normally triggers when your server is loading a page. But, to clarify this issues, the server must first send the ‘HTTP headers’, before the ‘HTML’ sections and the body tags. So, without the buffer commands, you’ll get something that looks like this: “Cannot modify header information – headers already sent by (output started at ……….)”
Example: “Warning: Cannot modify header information – headers already sent by (output started at /root/file.php:16) in /root/file.php on line 54″
This errors happens a lot on WordPress & Drupal. But, there is a way to suppress this problem.
We just add this bit of code – straight into the top of the page!
<?php // Enable output buffering ob_start(); ?>
For WordPress users, you’ll need to add this script into your ‘header.php’ file.
After that, just save your changes and the errors should be suppressed!
What is “ob_start” and what is this little function?
ob_start() is an output function that holds back any ‘output’ from the script until everything is ready to go. After that, it sends the headers and HTML.
Copyrighted By Lair360
?>/images/ads_logo.jpg)
