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
function getEmail($logindata)
{
$emailentered=$logindata['emailpost'];
return $emailentered;
}
Controller
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
<?php echo form_input(array('name'=>'email','readonly'=>'true','value'=>$emaigot));?>