- Forums
- PHP
- How To Stop Showing PHP Errors On Your Web Pages Scripts
have you noticed that sometimes on your page you see PHP warnings or errors that randomly appear but you wish you can hide them. this tutorial will show you how you can hide unnecessary php warning and errors you might be getting on your code [1052], Last Updated: Sat May 18, 2024
wallpaperama
Tue Jul 03, 2007
5 Comments
6895 Visits
have you noticed sometimes you are writing your scripts and then php shows you an error and the path of the file name with the line number.
sometimes its not a good idea to show this imformation because someone can use it against your site.
so there's a way you can hide the code on your php script by putting the folloing function at the begining of your scripts:
CODE:
ini_set('display_errors', 0);
like for example, i had a script and it kept showing me this error:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'adndhsd'@'localhost' (using password: YES) in C:htdocsscriptinstallindex.php on line 151 after i put the ini_set functionk, php stopped showing me the errors