note 31463 added to ref.outcontrol
| From: | someone at somedomain dot com | Date: | Tue, 22 Apr 2003 23:59:21 +0000 |
| Subject: | note 31463 added to ref.outcontrol | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46958@lists.php.net to get a copy of this message | ||
I had written a script that assembled different template components into a web page. It looked
something like this.
<?php
ob_start();
require ("template_part_1.php");
require ("template_part_2.php");
eval (template_part_3);
require ("template_part_3.php");
ob_end_flush();
?>
Under PHP 4.0.6 this ran just fine. After upgrading to 4.2.3 however, I started getting an odd
error which was consistant across both IE and Mozilla. The last tag on the output page (e.g.,
</html> was getting split into two parts with the last few characters of the tag being
pre-pended to the front of the output like so:
html><html>
{web code)
</
As you might imagine, this created problems for my page display. This problem occured only the
first time anyone loaded a page - the moment the page was refreshed the problem went away. After
much head banging I was able to suppress the error by placing the ob_end_clean() function just
before the ob_start() function as though there was a buffer that needed to be killed before the
buffer I was starting up with ob_start could function properly. I'm not sure why this worked,
but if anyone else is having this problem, this seems to be how to deal with it.
--
http://www.php.net/manual/en/ref.outcontrol.php
http://master.php.net/manage/user-notes.php?action=edit+31463
http://master.php.net/manage/user-notes.php?action=delete+31463
http://master.php.net/manage/user-notes.php?action=reject+31463