Помогите найти ошибку в function.php строка 40

SB
На сайте с 09.10.2017
Offline
2
547

Добрый день.

Помогите пожалуйста найти ошибку PHP - Undefined index:

Ошибка в строке 40 это вот эта: if ( $_GET['page'] == basename(__FILE__) ) {

Более полную часть кода привожу ниже:

<?php

$artThemeSettings = array(

'menu.showSubmenus' => true,

'menu.homeCaption' => "Главная",

'menu.showHome' => true,

'menu.topItemBegin' => "<span class=\"l\"></span><span class=\"r\"></span><span class=\"t\">",

'menu.topItemEnd' => "</span>"

);

load_theme_textdomain('kubrick');

$themename = "conteiner";

$shortname = "artisteer";

$default_footer_content = "<a href='#'>Contact Us</a> | <a href='#'>Terms of Use</a> | <a href='#'>Trademarks</a> | <a href='#'>Privacy Statement</a><br/>Copyright &copy; 2009 ".get_bloginfo('name').". All Rights Reserved.";

$options = array (

array( "name" => "Sidebar Ad 250x250",

"desc" => "This is for the 250x250 Yandex direct banner in the sidebar.<br /><br />",

"id" => "ctr_adsense_250",

"std" => "(Input html or direct code here)",

"type" => "textarea"),

array( "name" => "Footer",

"desc" => sprintf(__('<strong>XHTML:</strong> You can use these tags: <code>%s</code>', 'kubrick'), 'a, abbr, acronym, em, b, i, strike, strong, span'),

"id" => "art_footer_content",

"std" => $default_footer_content,

"type" => "textarea")

);

function art_update_option($key, $value){

update_option($key, (get_magic_quotes_gpc()) ? stripslashes($value) : $value);

}

function art_add_admin() {

global $themename, $shortname, $options;

if ( $_GET['page'] == basename(__FILE__) ) {

if ('save' == $_REQUEST['action'] ) {

foreach ($options as $value) {

if($value['type'] != 'multicheck'){

art_update_option( $value['id'], $_REQUEST[ $value['id'] ] );

}else{

foreach($value['options'] as $mc_key => $mc_value){

$up_opt = $value['id'].'_'.$mc_key;

art_update_option($up_opt, $_REQUEST[$up_opt] );

ME
На сайте с 03.07.2017
Offline
66
#1

У вас нет элемента page в массиве $_GET

N
На сайте с 01.12.2006
Offline
102
#2

Да, как выше было замечено, Вам необходимо проверить существование page. if(isset($_GET['page'])) ну и далее уже проверять дальше.

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий