You are here: Re: die() php but continuing on to html below the end php tag? « PHP Programming Language « IT news, forums, messages
Re: die() php but continuing on to html below the end php tag?

Posted by NC on 11/13/07 18:59

On Nov 13, 8:50 am, MS <No.Way.J...@No.Spam.Thank.You.com> wrote:
>
> Is there a php function that will stop executing the php code,
> but do any necessary clean-up, like die(), and will then go on
> to process any html in the file that is below the '?>' end php
> tag?

No. You have to take care of it yourself, not necessarily using
die(). Something like this would work:

<!-- Lots of PHP and HTML here -->
<?php

// Lots of PHP here

if ($error == 0) {
// continue as you would
} else {
// display error message or call error handler
}

?>
<!-- HTML footer here -->

> Or must I place the end page html in a php function
> and call that, say, as part of a MyDie() function.

You can, although I find it hard to believe this is a useful approach
for a non-trivial application. Dying is usually not a good idea...

Cheers,
NC

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация