PHP warning

Undefined array key 2

/home3/searchdo/public_html/profiles/index.php(3)

01 <?php 
02 $uri_segments = explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); 
03 $pagefor=explode("-",$uri_segments[2]);
04 $page = current($pagefor);
05 $location = end($pagefor); 
06 $pagename = $uri_segments[2];
07 echo $pagename;
08 $pagetitle = ucfirst(str_replace("-", " ", $uri_segments[1]));
09 
10 switch($page)
11 {
12     case "ngo": require_once(dirname(__FILE__) . '/ngo.php');  
13     break;
14     case "job": require_once(dirname(__FILE__) . '/job.php');  
15     break;

Stack Trace

#3
+
 /home3/searchdo/public_html/index.php(11): CApplication->run()
06 $yii = dirname(__FILE__) . '/beta_thora_bachke_rahna/kya_hal_hai_beta/framework/yii.php';
07         $config = dirname(__FILE__) . '/protected/config/main.php';
08         defined('YII_DEBUG') or define('YII_DEBUG', TRUE);
09         defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 0);
10         require_once($yii);
11         Yii::createWebApplication($config)->run(); 
12         ?>
2025-04-23 23:03:47 Apache Yii Framework/1.1.10