Output Buffer Problem?
Posted: Mon Mar 26, 2007 8:41 am
feyd | Please use
It generated following parse error after first <?php ob_flush(); ?>. it starts some crazy code that I have no idea where it comes from.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
thanks for anyone who can help on this. I am sure that someone out there get to be smarter than me.
I got a parse error from a php generated php file.
Here is the php file to generate php code.Code: Select all
ob_start();
// Php Code
// Printing to the output buffer
$phpCode = ob_get_contents();
ob_end_clean();
$cacheCode=""; \\ some cache code
$phpCode = "<?php ob_start(); ?>". $cacheCode . $phpCode;
$phpCode .= "\n";
$phpCode .= "<!-- <?= \$_ENV['HOSTNAME'] ?> -->\n";
$phpCode .= "<?php ob_flush(); ?>";Code: Select all
<script>
function changeDiv()
<?php
if ($showWidthAlerts) {
?>
alert("Page Width: " + pageWidth);
alert("Column Id: 1070616 = " + getElement("resizeColumn1070616").style.width);
if (minReached == 1) {
alert("Min - Column Id: 1070616 = " + getElement("resizeColumn1070616").style.width);
}
if (maxReached == 1) {
alert("Max - Column Id: 1070616 = " + getElement("resizeColumn1070616").style.width);
}
<?php
} // END if - show width alerts
?>
} // END function - changeDiv
window.onresize=new Function("changeDiv()");
// -->
</script>
</body>
</html>
<?php
include_once "globalconsts.lib";
include_once "globaldb.lib";
?>
<!-- <?= $_ENV['HOSTNAME'] ?> -->
<?php ob_flush(); ?>ched == 1) {
alert("Max - Column Id: 1070616 = " + getElement("resizeColumn1070616").style.width);
}
<?php
} // END if - show width alerts
?>
} // END function - changeDiv
window.onresize=new Function("changeDiv()");
// -->
</script>
</body>
</html>
<?php
include_once "globalconsts.lib";
include_once "globaldb.lib";
?>
<!-- <?= $_ENV['HOSTNAME'] ?> -->
<?php ob_flush(); ?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]