note 31463 deleted from ref.outcontrol by alindeman
| From: | alindeman@php.net | Date: | Wed, 23 Apr 2003 00:01:47 +0000 |
| Subject: | note 31463 deleted from ref.outcontrol by alindeman | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-46959@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.