Page 1 of 1

Undefined index: actual in /var/www/hay/controller/main.php

Posted: Tue Nov 15, 2011 1:28 pm
by D_zone
I have this code yet still have an error,

Code: Select all

class Main {  
      
    private static $pages = Array(  
        'rolunk'     => 1,  
        'paprikahaz' => 2,  
        'lovagrend'  => 3,  
        'kapcsolat'  => 4,  
        'actual'   => 5  
    );  
public static function index() {  
        if (!isset($GLOBALS['url'][0])) {  
            Util::redirect('/actual');  
        } else {  
            $page = $GLOBALS['url'][0];  
            Util::setHeaders();  
            if (array_key_exists($page, self::$pages)) {  
                $article = Articles::getPage(self::$pages[$page]);  
                if (is_numeric($article['gallery_id'])) {  
                    TPL::getInstance()->assign('gallery_id', $article['gallery_id']);  
                    TPL::getInstance()->assign('gallery_image', Util::$gallery_image[$page]);   ------> line 36?  
                }  
                TPL::getInstance()->assign('actual', true);  
                TPL::getInstance()->assign('article_title', stripcslashes($article['title']));  
                  
                TPL::getInstance()->assign('article_seo_title', stripcslashes($article['seo_title']));  
                TPL::getInstance()->assign('article_keywords', stripcslashes($article['seo_keywords']));  
                TPL::getInstance()->assign('article_desc', stripcslashes($article['seo_description']));  
                  
                TPL::getInstance()->assign('article_body', stripcslashes($article['body']));  
            }  
        }  
    } 

Re: Undefined index: actual in /var/www/hay/controller/main.

Posted: Tue Nov 15, 2011 1:40 pm
by Celauran
Doesn't look like you posted the right code. I see no reference to an array index named 'actual' except for where you're defining the $pages array.