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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
D_zone
Forum Newbie
Posts: 14
Joined: Mon Nov 02, 2009 9:22 am

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

Post 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']));  
            }  
        }  
    } 
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

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

Post 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.
Post Reply