note 47474 added to function.ob-start

From: Date: Wed, 17 Nov 2004 15:41:25 +0000
Subject: note 47474 added to function.ob-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-80641@lists.php.net to get a copy of this message
Just would like to point out that for you beginners in PHP (those who aren't very familiar with coding and such) - If you keep receiving a "Header Already Sent" error on your site... Put the "ob_start();" at the very top of your page (or if you have a header include, then place it on the top of your header include). On Linux Systems w/ PHP 4.3.9 (version and system can be checked by your PHP web host's CPanel for your account) - I was able to bypass the flush function - it outputs the buffered heading at the end of your coding anyway (unless you need it to flush at a given moment for a purpose). I just thought I would clear that up for the beginners: You get a 'Header Already Sent' error, try using the code at the top of your PHP file or Header Included File: <?php ob_start(); // BUFFER THE HEADERS FOR ENTIRE PAGE ?> ------------- Continue Page Coding --------------- ---- Manual Page -- http://www.php.net/manual/en/function.ob-start.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47474 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47474&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47474&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47474&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47474&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47474&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47474&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47474&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80641) next »