Welcome Guest, Not a member yet? Register   Sign In
Data pass from one function to another in same controller?
#1

[eluser]Xeroxeen[/eluser]
I want to pass data from one function to another function in same controller.And then show that data on a view.This is my code parts.But it gives errors in view.Please can you help me?

Model

Code:
function getEmail($logindata)
{
  $emailentered=$logindata['emailpost'];
  return $emailentered;
}

Controller

Code:
public function Login()
{
  $this->load->view('header');
  $this->load->view('userLogIn');
  
  if($_POST) {
   $logindata=array(
     'emailpost'=>$_POST['email'],
     'passwordpost'=>$_POST['password']
   );
  
   $login_confirm=$this->systemModel->loginManagement($logindata);
  
            $emailgot=$this->systemModel->getEmail($logindata);
            $data['emailgot']=$emailgotvalue;
  
   if($login_confirm){
    $this->user($data);
   }
  
  }
  
  $this->load->view('footer');
}


public function user($data=array())
{
  $this->load->view('header');
  
  
  $data['emailgot'];
    

  $this->load->view('user',$data);
  $this->load->view('footer');
}

View

Code:
<?php echo form_input(array('name'=>'email','readonly'=>'true','value'=>$emaigot));?>


Messages In This Thread
Data pass from one function to another in same controller? - by El Forum - 06-29-2013, 08:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB