Re: How to write errorhandling??
| From: | Pierre-Alain Joye | Date: | Sun, 21 Oct 2001 19:39:03 +0000 |
| Subject: | Re: How to write errorhandling?? | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-13585@lists.php.net to get a copy of this message | ||
Hello,
> Warning: Cannot add header information - headers already sent by (output
> started at
> e:\projects\globosapiens\07_production\actual\account\include\user.php:256)
> in e:\projects\globosapiens\07_production\actual\account\include\user.php
> on line 260
> Where is the problem??? I can't see it.
You don't have to send anything else than headers or data that uses header
(cookies) before use any header functions. This error is probably due to an
echo/print or you keep a space before "<?".
To avoid php error/warning/notice or simply to debug/custom messages, take a
look to the set_error_handler/user_error/trigger_error functions in the
documentation.
They are prettz usefull to make a fully transparent error management system.
Your client will not see classic ugly messages. Another nice use is to debug
http headers functions.
Inside your own error_handler function you are able to write messages to
syslog (only on winnt/*nix, not winMe/9x), files, or whatever you want (or
directly in the header itself header("X-Debug-1: this a message") ).
Hope that helps,
pa