die();

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Adrianc333
Forum Newbie
Posts: 14
Joined: Sat Feb 17, 2007 5:44 am
Location: South Yorkshire, UK

die();

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
Post Reply