Page 1 of 1

Error handling

Posted: Tue Dec 09, 2008 11:39 am
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.

Re: Error handling

Posted: Tue Dec 09, 2008 1:27 pm
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

Re: Error handling

Posted: Wed Dec 10, 2008 11:46 pm
by novice4eva
error_reporting(0);//COMPLETELY DISABLE
error_reporting(1);//DISPLAY ERRORS BUT NOT WARNINGS