Jump to content

Error Suppression With @


skaterdav85

Recommended Posts

Yes you can. It is a good idea when using a MySQL command so people don't see the location of your database.

Link to comment
Share on other sites

In my humble opinion, the @ error-suppression method is a hack. You would be better served to find an error-handling method that suppresses the errors displayed to the site, but notifies you (the site Admin) by email. That way the client never sees the info as per the previous reply, yet you are notified of the error. As Site Admin, you need to know if/when errors happen in order to fix them. There is a good error-handler function in a book by Larry Ullman titled Php 5 Advanced, second edition. Chapter 2. ISBN : 0-321-37601-3.

Link to comment
Share on other sites

For production sites it's a good idea to use error logging instead of displaying errors to the screen, that way if people are reporting errors you can just check the error log to see what's happening. I never suppress errors, if an error happens I want to know about it.error_reporting(E_ALL);ini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'error.log');ini_set('html_errors', 0);ini_set('log_errors', 1);ini_set('display_errors', 0);That will log all errors and put them in a file called error.log in the same directory as the script.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...