done debuggin, now what?
Moderator: General Moderators
done debuggin, now what?
When I have finished debugging a script how do i make it so that it doesn't display the errors etc when there is an error....?
-
waskelton4
- Forum Contributor
- Posts: 132
- Joined: Mon Sep 09, 2002 6:42 pm
http://www.php.net/manual/en/ref.errorf ... -reportingyou can change those values with ini_set
Code: Select all
error_reporting E_ALL & ~E_NOTICE PHP_INI_ALL
display_errors "1" PHP_INI_ALL- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You can use the '@' symbol in front of a line of code to suppress any errors that might arise that you can't prevent, eg:
there's also the or die() statement to quit a script when something like a database is down:
you can put a custom function call into the die() function so that you can decide how errors are displayed.
IMHO, you shouldn't need to turn error_reporting off if you've done thourough testing of your site before making it live and got rid of errors that are under your control as well adding procedures to catch those that aren't especially when it comes to dodgy user input.
Mac
Code: Select all
@mail($to, $subject, $message);Code: Select all
@mysql_connect($host, $user, $pass) or die(error_message());IMHO, you shouldn't need to turn error_reporting off if you've done thourough testing of your site before making it live and got rid of errors that are under your control as well adding procedures to catch those that aren't especially when it comes to dodgy user input.
Mac
Thanks Twigletmac!
That's what i was looking for! Thanks!