Page 1 of 1
Show HTML but don't send headers
Posted: Sat Jun 03, 2006 4:35 pm
by tecktalkcm0391
I need something like this
Code: Select all
<?php
ob_start();
?>
//HTML GOES HERE
<?php
//more PHP
?>
//HTML GOES HERE
<?php
//more PHP
ob_flush();
?>
But I need it to not send headers or anything until it gets to the ob_flush(); how can i do this with still being to edit this page in WYSIWYG formate.
Posted: Sat Jun 03, 2006 4:52 pm
by Chris Corbyn
I'm not sure how this normally works... does apache send some headers before PHP has finished working? Do you mind if I ask why you need to do this so that we can maybe try to tackle the problem from a few different angles.
Re: Show HTML but don't send headers
Posted: Sat Jun 03, 2006 5:00 pm
by Christopher
As I have mentioned to you before, you need to start putting your presentation stuff in external template files. Then you can do:
Code: Select all
<?php
// this is the PHP code that deals with the request and decides what to do
// this is the PHP code that gets and process any data necessary for this page
// this is the PHP code that set vars that wiil be used in the template
ob_start();
include 'mytemplate2.php'; // this is the HTML and presentation related PHP code
ob_flush();
?>