Error handling

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
phpPain
Forum Newbie
Posts: 10
Joined: Mon Nov 24, 2008 6:14 am

Error handling

Post by phpPain »

I get this error;

Notice: Undefined offset: 4 in /nas/students/m/mcooke/unix/public_html/ebassignment/list.php on line 27

In some languages you can tell the PC to ignore certain types of error or not display any error message. Anyone know how to do this in PHP? The php files I have are fine but I just wont to hide the error message. Bad practice I know but I need a temporary fix.
Hannes2k
Forum Contributor
Posts: 102
Joined: Fri Oct 24, 2008 12:22 pm

Re: Error handling

Post by Hannes2k »

Hi,
phpPain wrote:The php files I have are fine but I just wont to hide the error message.
If you get that notice, your php file isn't fine.

Fix: error_reporting
User avatar
novice4eva
Forum Contributor
Posts: 327
Joined: Thu Mar 29, 2007 3:48 am
Location: Nepal

Re: Error handling

Post by novice4eva »

error_reporting(0);//COMPLETELY DISABLE
error_reporting(1);//DISPLAY ERRORS BUT NOT WARNINGS
Post Reply