Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-23-2004, 11:47 AM   PM User | #1
kab_184
Regular Coder

 
Join Date: Jun 2002
Posts: 138
Thanks: 0
Thanked 0 Times in 0 Posts
kab_184 is an unknown quantity at this point
error supressed?

hi

is there any way to stop error/warning appearing on php page.?

Like the parse errors ....permission error...?
so that script with error is not executed and to the user nothing ever went wrong on that page??

is it possible ?
__________________
Move on....
kab_184 is offline   Reply With Quote
Old 04-23-2004, 12:29 PM   PM User | #2
bcarl314
Mega-ultimate member


 
Join Date: Jun 2002
Location: Winona, MN - The land of 10,000 lakes
Posts: 1,855
Thanks: 1
Thanked 45 Times in 42 Posts
bcarl314 will become famous soon enough
Usually adding an "@" symbol in front of a function call will do it.

Otherwise, check out the error reporting info on the php.net site. There are config directives you can change on the fly.
( http://www.php.net/manual/en/functio...-reporting.php )
bcarl314 is offline   Reply With Quote
Old 04-23-2004, 12:51 PM   PM User | #3
kab_184
Regular Coder

 
Join Date: Jun 2002
Posts: 138
Thanks: 0
Thanked 0 Times in 0 Posts
kab_184 is an unknown quantity at this point
ya thanks for the page

so i can turn off the error reporting
nowto the visitor no error shows up but
is there someway that if the error happens an email alert is sent at a specified email address...to admin only?

// Turn off all error reporting
error_reporting(0);

how can i send the error occured in email to the admin only?
__________________
Move on....
kab_184 is offline   Reply With Quote
Old 04-23-2004, 03:06 PM   PM User | #4
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,890
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
you can define your own error handling rules with PHPs custom error handling
http://be.php.net/manual/en/ref.errorfunc.php

note you could also trap errors in your code i.e.

PHP Code:
<?
@mysql_query($sql);
if(
mysql_error()){
    
mail("admin@blah.com" ... etc
}
?>
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:24 PM.


Advertisement
Log in to turn off these ads.