Where to post redirection files after login?

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()
    {
   // $this->load->model('login_model');
   // $show =true;
   // $user = $this->login_model->showUser($show);
        $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';
            }
        }
    }

enter image description here

Now tell me where I should place my redirect files.

+3
source share
1 answer
public function processlogin()
    {
   // $this->load->model('login_model');
   // $show =true;
   // $user = $this->login_model->showUser($show);
        $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');
                $this->load->view('login_page/home');
            }
            else
            {
                echo 'Error';
            }
        }
    }
+2
source

All Articles