Looking at your actual source, the relevant portion (with line numbers) is this:
745 if ( $_GET['page'] == basename(__FILE__) ) {
746
747 if ( 'save' == $_REQUEST['action'] ) {
748
749 foreach ($options as $value) {
750 update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
751
752 foreach ($options as $value) {
753 if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
754
755 header("Location: admin.php?page=admin-panel.php&saved=true");
756 die;
757
758 }
You’re checking for “page” inside the global $_GET
variable, but in this case, it’s not set. You need to run an isset()
check first.
745 if ( isset( $_GET['page'] ) && $_GET['page'] == basename(__FILE__) ) {
This will first check to see if we’ve passed in a value for ‘page’ in the request. If not, then we move on. If we have passed one in, though, then we’ll compare it to basename(__FILE__)
as normal.
You should use this same isset()
pattern with $_POST
and $_REQUEST
variables as well, otherwise you’ll get the same notices.