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).

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.