Click here to Skip to main content
14,332,494 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi
i'm trying to install script in my local using xampp and this error displayed to me

Notice: Undefined index: do in ....Assembler.php on line 51

and this is the code

class Lib_Core_Assembler
{
	
		
	public function __construct()
	{
		
		include('classes/Lib/dll.php');	
		$this->loadLibrayFiles($libraries);				
		$this->loadModelFiles($domapping, $globalmapping);	
		
	}
	
	private function loadLibrayFiles($library)
	{
		foreach($library as $key=>$item)	
			include(INSPATH.$item);	
	}
	
	private function loadModelFiles($domapping,$globalmapping)
	{
		if(isset($_GET['action']) && isset($_GET['action']{1}))
			$do = trim($_GET['do']).':'.trim($_GET['action']);
		else
			$do = trim($_GET['do']);
		if(array_key_exists($do,$domapping))
		{
			include(INSPATH.'classes/Model/'.$domapping[$do]['model'].'.php');
			$class = "Model_".$domapping[$do]['model'];			
			$function = $domapping[$do]['function'];
			$obj = new $class;
			$obj->$function();			
		}
		else 
		{
			include_once(INSPATH.'classes/Model/'.$globalmapping['invalidrequest']['model'].'.php');
			$class = "Model_".$globalmapping['invalidrequest']['model'];			
			$function = $globalmapping['invalidrequest']['function'];
			$obj = new $class;
			$obj->$function();
		}
	}
	
	private function loadSettings()
	{
		$set = new Lib_CacheSettings();
		$set->cacheSiteSettings();		
	}
}


and line 51 = $do = trim($_GET['do']); (after first else)
any idea?

regards
Posted
Updated 11-Apr-13 4:28am
v4
Comments
Matej Hlatky 11-Apr-13 5:58am
   
Where exactly is line 51 in your code sample?
Remember that you can suppress this kind of notices with @, like you used in @include('classes/Lib/dll.php');
mohannadzayyad 11-Apr-13 6:03am
   
Updated thanks..
DinoRondelly 11-Apr-13 12:29pm
   
Do a isset($_GET['do']) to see its set before you try to get the value. That will at least narrow down the issue
Prasad Khandekar 11-Apr-13 15:42pm
   
Hello,

Here is a good article on this (http://notesofgenius.com/how-fix-php-notice-undefined-index/)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100