Re: Trapping and masking errors
| From: | Yasuo Ohgaki | Date: | Mon, 03 Dec 2001 06:58:17 +0000 |
| Subject: | Re: Trapping and masking errors | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14756@lists.php.net to get a copy of this message | ||
Torrentuk wrote:
> Hi,
> I have written a simple form emailer for my site. In it I check to see if
> the mail was sent successfully and if not I write some variables to an error
> log. My question is, I would also like to write any php errors to the log
> file, e.g.
>
> Warning: Failed to Connect in d:\WWW\htdocs/RND_ski-info-online/contact.php
> on line 152
>
> how would I specify them in error_log()? Also how can I mask them from
> appearing in the visitor's browser window so that I can just write my
> "friendlier" error message there.
>
> Anyone hints, tips or just downright solutions would be greatly appreciated
> :)
> -torrent
How about take a look at the manual page?
http://www.php.net/manual/en/ref.errorfunc.php
You may also be interested in output buffering.
Look for ob_start(), ob_end_clean(), etc.
--
Yasuo Ohgaki