[PHP] Outputting HTML with PHP - Buffer Problem?

2004-09-12 Thread Nick Wilson
Hi all, Say i have a php script like this: ?php print(html_head()); // do loads of time taking stuff print(html_footer()); ? How come I dont see the html header (it's just a function that returns a string with the html up till body) before the entire script has run? This goes against my

Re: [PHP] Outputting HTML with PHP - Buffer Problem?

2004-09-12 Thread John Holmes
Nick Wilson wrote: Say i have a php script like this: ?php print(html_head()); // do loads of time taking stuff print(html_footer()); ? How come I dont see the html header (it's just a function that returns a string with the html up till body) before the entire script has run? This goes

Re: [PHP] Outputting HTML with PHP - Buffer Problem?

2004-09-12 Thread Jason Davidson
There is nothing wrong with what your doing, i use this sort of thing for all the big sites i make, i use a page class and use methods to create the header and footer, so your concept is good. I would investigate your html_head() function, to make sure its actually returning something. Sinse

Re: [PHP] Outputting HTML with PHP - Buffer Problem?

2004-09-12 Thread dirk
Well, there is a difference between function html_head() { $html = html; return $html; } and function header() { ? html head title ? } The first function you need to call using ? echo header(); ? to see the output THe second function

Re: [PHP] Outputting HTML with PHP - Buffer Problem?

2004-09-12 Thread raditha dissanayake
dirk wrote: The first function you need to call using ? echo header(); ? to see the output THe second function is not a real function because it has no return statement. In german you call this Prozedur. Don't know if it's the same as procedure in english. But you will call this piece ? header();

Re: [PHP] Outputting HTML with PHP - Buffer Problem?

2004-09-12 Thread Nick Wilson
* and then Jason Davidson declared i prefer to escape from php inside my header fucntion, and just not print it.. eg. function header() { ? html head title ? } Yes, i remember now, thanks ;-) I've been using Smarty (smarty.php.net) for so long now that i've forgotten

Re: [PHP] Outputting HTML with PHP - Buffer Problem?

2004-09-12 Thread Nick Wilson
* and then John Holmes declared How come I dont see the html header (it's just a function that returns a string with the html up till body) before the entire script has run? This goes against my understanding, why might this be and what might i use to get some output before the script

Re: [PHP] Outputting HTML with PHP - Buffer Problem?

2004-09-12 Thread Jason Davidson
yup, you took the words from my mouth... [EMAIL PROTECTED] wrote: dirk wrote: The first function you need to call using ? echo header(); ? to see the output THe second function is not a real function because it has no return statement. In german you call this Prozedur. Don't know if