Welcome Guest, Not a member yet? Register   Sign In
undefined variable (newbie)
#8

[eluser]John_Betong[/eluser]
 
Hi jorre and thatscriptguy,

Looking at the code it appears that your code should be re-arranged so that the variables $title, $heading are declared before loading the view.

Also $this->load->view(...) generates and outputs a string.

I prefer using the $result variable and then to echo the $result

Try this code:
 

Code:
if($this->validation->run() == FALSE)
{
   //SHOW STEP 2
   $data['title']   = "My Real Title";
   $data['heading'] = "My Real Heading";        

   $result  = $this->load->view('header', $data, TRUE);        
   $result .= $this->load->view('pollcreate_step2',$data, TRUE);    //reload step 2
   $result .= $this->load->view('footer', $data, TRUE);    
  
   echo $result; // EDIT: CORRECTED VARIABLE NAME from $output
}

 
 
If on the offchance this does not work then:
1. take small bites at the code
2. get a "Hello World" to output with no errors
3. gradually increase the complexity.
 
 


Messages In This Thread
undefined variable (newbie) - by El Forum - 02-12-2008, 05:50 PM
undefined variable (newbie) - by El Forum - 02-12-2008, 07:59 PM
undefined variable (newbie) - by El Forum - 02-12-2008, 08:11 PM
undefined variable (newbie) - by El Forum - 02-12-2008, 08:35 PM
undefined variable (newbie) - by El Forum - 02-12-2008, 09:06 PM
undefined variable (newbie) - by El Forum - 02-12-2008, 09:23 PM
undefined variable (newbie) - by El Forum - 02-12-2008, 09:27 PM
undefined variable (newbie) - by El Forum - 02-12-2008, 09:31 PM
undefined variable (newbie) - by El Forum - 02-12-2008, 09:31 PM
undefined variable (newbie) - by El Forum - 02-12-2008, 09:37 PM
undefined variable (newbie) - by El Forum - 02-12-2008, 10:20 PM
undefined variable (newbie) - by El Forum - 02-13-2008, 03:42 AM
undefined variable (newbie) - by El Forum - 02-13-2008, 03:46 AM
undefined variable (newbie) - by El Forum - 02-13-2008, 05:41 AM
undefined variable (newbie) - by El Forum - 02-13-2008, 01:01 PM
undefined variable (newbie) - by El Forum - 02-13-2008, 01:10 PM
undefined variable (newbie) - by El Forum - 03-24-2009, 01:46 AM
undefined variable (newbie) - by El Forum - 03-24-2009, 02:09 AM
undefined variable (newbie) - by El Forum - 03-24-2009, 02:20 AM
undefined variable (newbie) - by El Forum - 03-24-2009, 02:32 AM
undefined variable (newbie) - by El Forum - 03-24-2009, 02:42 AM
undefined variable (newbie) - by El Forum - 07-06-2011, 06:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB