Fix Error: Notice: Undefined index: folder in

To fix this error all you have to do is define the variable PHP is complaining about. If you look at your script and there is no 'index' variable, then that means it could be a $_REQUEST, $_POST or $_GET type of variable, in my case I had $_GET['folder'] like this:

echo $_GET['folder'];

but I did not have this parameter in my URL so it did not exists (undefinned)

to fix it, I declared the parameter if it was empty, like this:

if(!$_GET['folder'])$_GET['folder']='';echo $_GET['folder'];

After that, no more notice errors.

alternatively, you can supress errors, notices and warnings like this in PHP:

error_reporting(E_ALL & ~E_NOTICE);

Here is more information:

error_reporting(E_ALL);
ini_set('display_errors',1);
// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);
//http://php.net/manual/en/function.error-reporting.php

=++++++++++++++
NEW:

; Common Values:
;   E_ALL (Show all errors, warnings and notices including coding standards.)
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices)
;   E_ALL & ~E_NOTICE & ~E_STRICT  (Show all errors, except for notices and coding standards warnings.)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting