Controller:
$data = array(
'error_message' => 'Invalid Username or Password'
);
$this->load->view('/login/index', $data);
View page:
<?php echo $error_message; ?>
Controller:
$data = array(
'error_message' => 'Invalid Username or Password'
);
$this->load->view('/login/index', $data);
View page:
<?php echo $error_message; ?>
I guess you have put the view
path wrong and hence the variable is not reaching the view
.
This is how it should be,
Controller: (applications/controllers/filename.php)
$data = array(
'error_message' => 'Invalid Username or Password'
);
$this->load->view('login/index', $data); # removed slash here
View: (applications/views/login/index.php)
<?php echo $error_message; ?>