Lian Liming wrote:
We are running a php program for business. We want to hand the
error in the following way: Don't display the error messages but give
some other information such as our service telephone number and some
others. It is useful for our customers to get quick help when problems
happen.
How can i do that? Thanks for your suggestion!
Check out the PHP manual for error handling and logging
http://www.php.net/manual/en/ref.errorfunc.php
But it is better to not have errors in your scripts :)
Everytime a function can fail, test for failure and call an appropriate
function to deal with it
<?php // assume ALL_CAPS are define()'d constants
/* ... */
mysql_connect(DB_HOST, DB_USER, DB_PASS) or handle_error(ERR_CONN);
/* ... */
if ($x == 0) handle_error(ERR_DIV0);
/* ... */
?>
where the handle_error() function does whatever you want, including
sending HTML to the client with your service telephone number and other
data you might need.
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :