I am doing a project in codeigniter. My login page completed successfully. After logging in, I want to redirect to the home page. My login code only succeeds, the problem is with the redirect method. I also provided my directory structure for reference.
the code:
public function processlogin()
{
$username = $this->input->post('user_name');
$password = $this->input->post('password');
{
$this->load->model('login_model');
$this->load->database();
$query = $this->db->get_where('tbllogin', array('login_name' => $username,'password' => $password));
$count1 = count($query->result());
if($count1 === 1)
{
$this->load->helper('url');
redirect('login_page/home');
}
else
{
echo 'Error';
}
}
}

Now tell me where I should place my redirect files.
source
share