473,385 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

die() php but continuing on to html below the end php tag?

MS
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.
Nov 13 '07 #1
5 3734
On 13 Nov, 16:50, MS <No.Way.J...@No.Spam.Thank.You.comwrote:
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...');

?>


Nov 13 '07 #2
MS
Captain Paralytic emailed this:
On 13 Nov, 16:50, MS <No.Way.J...@No.Spam.Thank.You.comwrote:
>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.
Nov 13 '07 #3
On 13 Nov, 17:04, MS <No.Way.J...@No.Spam.Thank.You.comwrote:
Captain Paralytic emailed this:


On 13 Nov, 16:50, MS <No.Way.J...@No.Spam.Thank.You.comwrote:
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.

Nov 13 '07 #4
MS
Captain Paralytic emailed this:
On 13 Nov, 17:04, MS <No.Way.J...@No.Spam.Thank.You.comwrote:
>Captain Paralytic emailed this:


>>On 13 Nov, 16:50, MS <No.Way.J...@No.Spam.Thank.You.comwrote:
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..
Nov 13 '07 #5
NC
On Nov 13, 8:50 am, MS <No.Way.J...@No.Spam.Thank.You.comwrote:
>
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

Nov 13 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rey | last post by:
Howdy all. Am attempting to delete a large number of records (123K) from a table using: db.execute "delete from tblname" Then I double check (code below) to see if records still remain as...
1
by: Ted | last post by:
Hello, Is there an equivalent to die(reason) in ASP.NET? I have a ValidateData() function that returns a boolean, so instead of If condition Then Response.Writeline(reason): Return False ...
12
by: googlegroups | last post by:
Hi, I'm making a javascript program for rolling dice for a roleplaying game that's played in a forum. The die roll gets generated, gets stored as text in a hidden form field, and then gets written...
5
by: Patrick | last post by:
Hi All, Background image is in place and a Div (yellow border) inside center Div column is positioned where I want it to be. Now the problem is that in Mozilla my third column div is dropping...
2
by: acorn71 | last post by:
Hello, I have a background image that needs to continue to infinity. Currently, I have a band-aid solution where I've made my background image 3000px and kept it pretty small in file size with...
3
by: marsguy85 | last post by:
Hello friends i have to do the following thing and i am still learning ANSI C . Can anyone tell me how to go about it . please. thanks --------------------------------------- write a program...
4
by: Eddie | last post by:
I am opening a windows (well, technically a greybox() call GB_show() which shows a nicer window than normal), and want to wait until that window is closed before moving to the next command. ...
1
by: Kburge03 | last post by:
Hi!! I've been working on this assingment for class where I have to design and implement an application that displays two Die objects, a button, and a label. Every time the button is pushed, the...
1
by: virgiloz | last post by:
Continuing on from my heartache post earlier, can I nest a <choose> element inside of: <td align="center" style="border: 3px solid #CC0033" bgcolor="#FFAABF" class="v10"> Ie: is the following...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.