Title: Getting Error in Function PHP After Debug set true
Last modified: August 21, 2016

---

# Getting Error in Function PHP After Debug set true

 *  [Sandy](https://wordpress.org/support/users/sandy786/)
 * (@sandy786)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/getting-errorin-function-php-after-debut-set-true/)
 * Hi i’m getting error in my theme after set debug true can any body help me to
   resolve them
 *     ```
       Notice: Undefined index: in C:\xampp\htdocs\wp\wp-content\themes\mytheme\functions.php on line 396
   
       Notice: Undefined index: id in C:\xampp\htdocs\wp\wp-content\themes\mytheme\functions.php on line 399
       ```
   
 * and
    `Warning: Cannot modify header information - headers already sent by (output
   started at C:\xampp\htdocs\wp\wp-content\themes\mytheme\functions.php:396) in
   C:\xampp\htdocs\wp\wp-content\themes\mytheme\functions.php on line 401`
 * here is my **function.php from line 386 to 419**
 *     ```
       function mytheme_add_admin() {
   
       global $themename, $shortname, $options;
   
       if ( isset($_GET['page']) && $_GET['page'] == basename(__FILE__) ) { 
   
         if ( 'save' == ( isset($_REQUEST['action'] ) && $_REQUEST['action'] ) ) { 
   
       		foreach ($options as $value) {
       		update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
   
       foreach ($options as $value) {
       	if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); } }
   
       	header("Location: admin.php?page=functions.php&saved=true");
       header("Location: themes.php?page=functions.php&saved=true");
       die;
   
       } else if ( 'reset' == ( isset($_REQUEST['action'] ) && $_REQUEST['action'] ) ) { 
   
       	foreach ($options as $value) {
       		delete_option( $value['id'] ); }
   
       	header("Location: admin.php?page=functions.php&reset=true");
       		header("Location: themes.php?page=functions.php&reset=true");
   
       die;
   
       }
       }
   
       add_theme_page($themename, $themename, 'administrator', basename(__FILE__), 'mytheme_admin');
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Bas Schuiling](https://wordpress.org/support/users/basszje/)
 * (@basszje)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/getting-errorin-function-php-after-debut-set-true/#post-3680381)
 * If you want debug information you get debug information. If you don’t know what
   to do with it I’d suggest to leave it alone then.
 * This is very basic PHP behaviour, you might want to find an online free course
   or so to catch up.
 *  [gerardbm](https://wordpress.org/support/users/gerardbm/)
 * (@gerardbm)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/getting-errorin-function-php-after-debut-set-true/#post-3680595)
 * Hi [@sandy](https://wordpress.org/support/users/sandy/). Could you fix it? I’m
   having exactly the same problem. I know it was 7 months ago, but an answer would
   be very helpful for me. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Getting Error in Function PHP After Debug set true’ is closed to new 
replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [gerardbm](https://wordpress.org/support/users/gerardbm/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/getting-errorin-function-php-after-debut-set-true/#post-3680595)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
