Welcome Guest, Not a member yet? Register   Sign In
Unable to load the requested file
#1

(This post was last modified: 09-05-2020, 06:15 AM by includebeer. Edit Reason: removed non-english text )

I tried to create a login system using ion_auth library
 This is my welcome controller:
PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
Welcome extends CI_Controller {

public function 
__construct(){
    
parent
::__construct();
$this->load->library('ion_auth');
  if (!$this->ion_auth->logged_in())
    {
    redirect('auth/login''refresh');
     
    
}
    
}

    public function 
index()
    {
    
$this->load->view('welcome_message');


    }

 When I Run this shows an error

An Error Was Encountered

Unable to load the requested file: auth/login.php

How can I fix this?
Reply
#2

(This post was last modified: 09-05-2020, 08:32 PM by Omar Crespo.)

Just use header instead of redirect, like this:

header('Location:' . site_url('auth/login'));
exit();

I'm just asuming that auth is a controller, and login it's method.

Hope it helps.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB