amplarede / uizard

Automatically exported from code.google.com/p/uizard
Other
0 stars 1 forks source link

Undefined index, variable, offset 등의 에러 삭제 #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Undefined index, variable, offset 에러가 너무 많이 발생하여 개발 
및 디버깅
시에 난점이 많음.

최소화가 필요함.

Original issue reported on code.google.com by eerien on 17 May 2009 at 3:58

GoogleCodeExporter commented 9 years ago
As a result of check this problem, undefined index error and etc are occurred 
when
using global variables.

If we use undefined variables like $_GET['projectname'], the error will be 
occurred.

One of solution is rewriting code like below.

if (isset($_GET['projectname'])
    $projectName = $_GET['projectname'];

Another one is modify PHP error reporting option.
In php.ini file, we can exclude 'notice level' errors such as undefined index 
error
by using below option.

error_reporting  =  E_ALL & ~E_NOTICE

I think, second method is better.
So, close this issue.

Original comment by eerien on 19 May 2009 at 3:09