Hello coders! I want to hide a php error shown in a script. Am adding this code in the first line in php: error_reporting(0); Also many other variants of this code. The problem: When I add this line the PHP error is not showing any more but on the header of the site this code shows: error_reporting(0); I wave tried to disable php errors only for this site via httpd.conf without success. Tried via php.ini and .htaccess also without success! @digitalpoint any idea? Thank you everyone!
I'd say you have the error reporting statement in the plain html, rather than in a php section The other way you could do it is with ob_start() etc to catch the error and dump it. I'd prefer to have the error handled properly though. Even with a try() statement
Hi Sarah. It could not be in html because the error is not showing after adding that code on the beginning of the script. But anyway, could you please explain where and how to use your code/option? Am not skilled on php that much Thank you!
How about you paste a bit of your code, including the bit with the error you are trying to hide. remember to use the bbcode!
Hiding an error is just disguising the problem. The correct approach would be to eliminate the error.
Yeah, why are you trying to hide the error, instead of, oh I don't know... FIX THE BLOODY PROBLEM?!? :/