Re: [PHP] Error Handling question

2007-08-07 Thread Richard Lynch
On Mon, August 6, 2007 4:41 am, debussy007 wrote:
 I am new to PHP and need some help for error handling.

 I read in the docs that i can handle the errors this way in my PhP:

 set_error_handler('errorHandler');
 function errorHandler($errnum,$errmsg,$file,$lineno){
 [...]
 }

 But does that mean that I have to copy paste this code in all my Php
 pages
 or is there a better way ?

Put it in an include file with all the other functions you are going
to need shortly.

http://php.net/include

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Error Handling question

2007-08-06 Thread debussy007

Hi,

I am new to PHP and need some help for error handling.

I read in the docs that i can handle the errors this way in my PhP:

set_error_handler('errorHandler');
function errorHandler($errnum,$errmsg,$file,$lineno){
[...]
}

But does that mean that I have to copy paste this code in all my Php pages
or is there a better way ?

Thank you.
-- 
View this message in context: 
http://www.nabble.com/Error-Handling-question-tf4223141.html#a12013437
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Handling question

2007-08-06 Thread brian

debussy007 wrote:

Hi,

I am new to PHP and need some help for error handling.

I read in the docs that i can handle the errors this way in my PhP:

set_error_handler('errorHandler');
function errorHandler($errnum,$errmsg,$file,$lineno){
[...]
}

But does that mean that I have to copy paste this code in all my Php pages
or is there a better way ?



You could use auto_prepend_file:

http://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file

brian

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php