Another Noob Question (Undefined Index Error)
Posted: Mon Nov 09, 2009 2:27 pm
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Hello World.
I am having problems getting this dynamic index.php working. In the error log I get the following error:
PHP Notice: Undefined index: p in /usr/home/hearbr/www/htdocs/APP/Front/Controller/Default.php on line 2
I know that means that p is not defined, but what is crazy is that this works on my old host, that is running PHP 5.2.11 and the new one is running PHP 5.2.6.
I tried doing an ifsset but it did not work either any help would be appreciated here is the entire function:
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Hello World.
I am having problems getting this dynamic index.php working. In the error log I get the following error:
PHP Notice: Undefined index: p in /usr/home/hearbr/www/htdocs/APP/Front/Controller/Default.php on line 2
I know that means that p is not defined, but what is crazy is that this works on my old host, that is running PHP 5.2.11 and the new one is running PHP 5.2.6.
I tried doing an ifsset but it did not work either any help would be appreciated here is the entire function:
Code: Select all
function actionIndex(){
switch ($this->get['p']){
case 'ourstaff':
$content=$this->_page->find(2);
$view=array(
'title'=>$content['title'],
'content'=>$content['content'],
);
$this->display($view,'ourStaff');
break;
case 'forms':
$content=$this->_page->find(3);
$view=array(
'title'=>$content['title'],
'content'=>$content['content'],
);
$this->display($view,'forms');
break;
case 'insurance':
$content=$this->_page->find(4);
$view=array(
'title'=>$content['title'],
'content'=>$content['content'],
);
$this->display($view,'insurance');
break;
case 'services':
$content=$this->_page->find(5);
$view=array(
'title'=>$content['title'],
'content'=>$content['content'],
);
$this->display($view,'services');
break;
case 'products':
$content=$this->_page->find(6);
$view=array(
'title'=>$content['title'],
'content'=>$content['content'],
);
$this->display($view,'products');
break;
case 'contactus':
$content=$this->_page->find(7);
$view=array(
'title'=>$content['title'],
'content'=>$content['content'],
);
$this->display($view,'contactUs');
break;
case 'wecanhelp':
$content=$this->_page->find(8);
$view=array(
'title'=>$content['title'],
'content'=>$content['content'],
);
$this->display($view,'weCanHelp');
break;
default:
$content=$this->_page->find(1);
$view=array(
'content'=>$content['content'],
);
$this->display($view);
}
}pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: