Search code examples
phpwordpressnotice

PHP Notice: Undefined index


I am getting a Notice in a wordpress theme, but i think its a general PHP warning.

Notice: Undefined index: saved in ..\functions.php on line 255

The line 255 reads as:

if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>';

Any suggestion, how i can fix it?

Thanks.


Solution

  • Change to:

    if(isset($_REQUEST['saved']))
    

    You should consider using a method specific super-array like $_GET or $_POST instead of the more general $_REQUEST array.