Forum Moderators: coopster
die() What I have noticed is that this command seems to stop both the PHP and remaining HMTL script from being processed.
My question is, is there any way of stopping the script from executing, but leaving the regular HTML to carry on executing?
there is an example here
[php.net...]
<?php
$result = mysql_query('SELECT * WHERE 1=1');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
?>
you don't to use die inside the if and possibly could do your real processing in the if and have an else that handles the invalid query, maybe something like
<?php
$result = mysql_query('SELECT * WHERE 1=1');
if ($result) {
// continue processing
} else {
// show some default html
}
?>
something like that would work