PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > die() php but continuing on to html below the end php tag?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
die() php but continuing on to html below the end php tag?

Réponse
 
LinkBack Outils de la discussion
Vieux 13/11/2007, 17h50   #1
MS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut die() php but continuing on to html below the end php tag?

Hi,

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? Both die() and exit() exit
without processing the html after the end php tag.

E.G.

SOME HTML...

<?php

SOME PHP...

Call End PHP processing function (jumps to end the page neatly html).

?>

END PAGE NEATLY HTML...


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

Thanks.
  Réponse avec citation
Vieux 13/11/2007, 17h58   #2
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: die() php but continuing on to html below the end php tag?

On 13 Nov, 16:50, MS <No.Way.J...@No.Spam.Thank.You.com> wrote:
> Hi,
>
> 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? Both die() and exit() exit
> without processing the html after the end php tag.
>
> E.G.
>
> SOME HTML...
>
> <?php
>
> SOME PHP...
>
> Call End PHP processing function (jumps to end the page neatly html).
>
> ?>
>
> END PAGE NEATLY HTML...
>
> Or must I place the end page html in a php function and call that, say, as
> part of a MyDie() function.
>
> Thanks.



<?php


SOME PHP...


die('END PAGE NEATLY HTML...');

?>




  Réponse avec citation
Vieux 13/11/2007, 18h04   #3
MS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: die() php but continuing on to html below the end php tag?

Captain Paralytic emailed this:
> On 13 Nov, 16:50, MS <No.Way.J...@No.Spam.Thank.You.com> wrote:
>> Hi,
>>
>> 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? Both die() and exit() exit
>> without processing the html after the end php tag.
>>
>> E.G.
>>
>> SOME HTML...
>>
>> <?php
>>
>> SOME PHP...
>>
>> Call End PHP processing function (jumps to end the page neatly html).
>>
>> ?>
>>
>> END PAGE NEATLY HTML...
>>
>> Or must I place the end page html in a php function and call that, say, as
>> part of a MyDie() function.
>>
>> Thanks.

>
>
> <?php
>
>
> SOME PHP...
>
>
> die('END PAGE NEATLY HTML...');
>
> ?>


Thanks. Should I take it that the answer is no?

Cheers.
  Réponse avec citation
Vieux 13/11/2007, 18h11   #4
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: die() php but continuing on to html below the end php tag?

On 13 Nov, 17:04, MS <No.Way.J...@No.Spam.Thank.You.com> wrote:
> Captain Paralytic emailed this:
>
>
>
>
>
> > On 13 Nov, 16:50, MS <No.Way.J...@No.Spam.Thank.You.com> wrote:
> >> Hi,

>
> >> 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? Both die() and exit() exit
> >> without processing the html after the end php tag.

>
> >> E.G.

>
> >> SOME HTML...

>
> >> <?php

>
> >> SOME PHP...

>
> >> Call End PHP processing function (jumps to end the page neatly html).

>
> >> ?>

>
> >> END PAGE NEATLY HTML...

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

>
> >> Thanks.

>
> > <?php

>
> > SOME PHP...

>
> > die('END PAGE NEATLY HTML...');

>
> > ?>

>
> Thanks. Should I take it that the answer is no?
>
> Cheers.- Hide quoted text -
>
> - Show quoted text -


What I posted is the way such a thing is implemented in php.

  Réponse avec citation
Vieux 13/11/2007, 18h19   #5
MS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: die() php but continuing on to html below the end php tag?

Captain Paralytic emailed this:
> On 13 Nov, 17:04, MS <No.Way.J...@No.Spam.Thank.You.com> wrote:
>> Captain Paralytic emailed this:
>>
>>
>>
>>
>>
>>> On 13 Nov, 16:50, MS <No.Way.J...@No.Spam.Thank.You.com> wrote:
>>>> Hi,
>>>> 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? Both die() and exit() exit
>>>> without processing the html after the end php tag.
>>>> E.G.
>>>> SOME HTML...
>>>> <?php
>>>> SOME PHP...
>>>> Call End PHP processing function (jumps to end the page neatly html).
>>>> ?>
>>>> END PAGE NEATLY HTML...
>>>> Or must I place the end page html in a php function and call that, say, as
>>>> part of a MyDie() function.
>>>> Thanks.
>>> <?php
>>> SOME PHP...
>>> die('END PAGE NEATLY HTML...');
>>> ?>

>> Thanks. Should I take it that the answer is no?
>>
>> Cheers.- Hide quoted text -
>>
>> - Show quoted text -

>
> What I posted is the way such a thing is implemented in php.


Thanks. Regards, etc..
  Réponse avec citation
Vieux 13/11/2007, 19h59   #6
NC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: die() php but continuing on to html below the end php tag?

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

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 16h55.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13115 seconds with 14 queries