Hiding warnings?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jkelly
Forum Newbie
Posts: 6
Joined: Tue May 31, 2005 10:12 am

Hiding warnings?

Post by jkelly »

Is there a way of hiding all warnings that come up on your browser? I have my project demonstration in an hour and i NEED to get rid of them!!!!
Thanks
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

On the very top line in a <?php ?> block add

Code: Select all

error_reporting(0);
Then after the demonstration go fix your code :P
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

if you have access to the php.ini you can alway turn the error reporting off. Then restart your server.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

phpScott wrote:if you have access to the php.ini you can alway turn the error reporting off. Then restart your server.
Also worth noting... ini_set()
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

To only turn warnings off, but leave error-messages

Code: Select all

error_reporting (E_ALL ^ E_NOTICE);
just like the ultimate guide says.
Post Reply