Page 1 of 1

die();

Posted: Sat Apr 28, 2007 12:07 pm
by Adrianc333
Hey,

So, i am using a Template system, at the top of my page, i echo my header, using print_header()

And then my other "content" templates later on.
Though, when i want to put in a die(); it still prints me header.

I know it's because i already outputted my header template, but is there anyway the die() function, can clear any previously outputted code, and print the die message, on a blank white page?

Sorry if that was hard to understand.

Any help is appreciated. :)
Thanks, Adrian

Posted: Sat Apr 28, 2007 12:16 pm
by Chris Corbyn
No way to do it directly, but maybe you want to look at the output buffering functions to delay output.

http://www.php.net/ob_start

It sounds as though you should really be loading your page in a different order though, and then piece it together like a jigsaw puzzle. MVC is the term to read up on if you want crazily flexible + clean templated layouts.