Jump to content

[SOLVED] Help with Errors.


Demonic

Recommended Posts

Well for example:  The header will show, then I tell the user if hes banned it will show the message but not the rest of the html(rest of the script,footer) so the footer is cut off completely.  ( I was thinking maybe a redirect or something I not sure what Ill do).

 

 

 

or, rather than using the die() function, you could write your own function to handle the error. Eg;

 

function error_handler($error){

echo "Formatting, layout etc.";

echo $error;

die();

}

 

And then just use error_handler("Something bad happened") in your code instead of die() or exit.

 

 

The whole point of the die() function is to stop executing all code right there and the. If a die() function is executed, the script does just that, it dies.

 

Edit: Forgot to put the die() in the function...without that, it'll output your error and then try to continue executing any code that it hasn't executed yet.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.