LemonInflux Posted September 15, 2007 Share Posted September 15, 2007 I used a show error code once, can't remember which, but now I've looked at my site, every error on every page is showing, including undefined variable errors (partly because they're defined by forms on that page). So how do I hide all errors? Quote Link to comment https://forums.phpfreaks.com/topic/69511-hide-errors/ Share on other sites More sharing options...
pocobueno1388 Posted September 15, 2007 Share Posted September 15, 2007 Try putting this at the top of your script. error_reporting(0); Quote Link to comment https://forums.phpfreaks.com/topic/69511-hide-errors/#findComment-349266 Share on other sites More sharing options...
nathanmaxsonadil Posted September 15, 2007 Share Posted September 15, 2007 I haven't actually tried this myself but I heard if you put @ in front of the line it will suppress the error's Quote Link to comment https://forums.phpfreaks.com/topic/69511-hide-errors/#findComment-349267 Share on other sites More sharing options...
darkfreaks Posted September 15, 2007 Share Posted September 15, 2007 error_reporting(0); or @ will supress errors Quote Link to comment https://forums.phpfreaks.com/topic/69511-hide-errors/#findComment-349275 Share on other sites More sharing options...
pocobueno1388 Posted September 15, 2007 Share Posted September 15, 2007 error_reporting(0); or @ will supress errors Both of those were suggested in the only two posts...was it really necessary to say it again? Quote Link to comment https://forums.phpfreaks.com/topic/69511-hide-errors/#findComment-349279 Share on other sites More sharing options...
LemonInflux Posted September 16, 2007 Author Share Posted September 16, 2007 Yeah, but it's happening on -every- page. Is there a way just to do the site as one? Quote Link to comment https://forums.phpfreaks.com/topic/69511-hide-errors/#findComment-349479 Share on other sites More sharing options...
Wuhtzu Posted September 16, 2007 Share Posted September 16, 2007 Not besides including error_reporting(0) on all pages or putting @ in front of all lines which produces errors... Actually there is one third option; write code which produces no errors Quote Link to comment https://forums.phpfreaks.com/topic/69511-hide-errors/#findComment-349480 Share on other sites More sharing options...
Sorthy359 Posted September 16, 2007 Share Posted September 16, 2007 i like the third suggestion..writing code that produces no errors. Quote Link to comment https://forums.phpfreaks.com/topic/69511-hide-errors/#findComment-349501 Share on other sites More sharing options...
LemonInflux Posted September 16, 2007 Author Share Posted September 16, 2007 I would, but it's things like pages where forms submit to the same page and CREATE the variable the second time round. And things like exploding values that are user created over time, not straight away. Quote Link to comment https://forums.phpfreaks.com/topic/69511-hide-errors/#findComment-349508 Share on other sites More sharing options...
nathanmaxsonadil Posted September 17, 2007 Share Posted September 17, 2007 you could make a file like supresserrors.php and in it have error_reporting(0); and include it on every page. Quote Link to comment https://forums.phpfreaks.com/topic/69511-hide-errors/#findComment-349990 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.