Welcome Guest, Not a member yet? Register   Sign In
user login
#1

[eluser]learning_php[/eluser]
I am trying to create a user login and have created the following controller:
Code:
<?PHP

class gallery extends Controller {
    
        
    function gallery()
    {
    
    parent::Controller();
    $this->load->database();
    $this->load->helper(array('url', 'form', 'date', 'cookie'));
    $this->load->library(array('form_validation', 'upload', 'Erkanaauth', 'session'));
    
    }
    
    function index(){
        $this->authorize();
        $this->load->view('gallery_view');
    }
function login()
  {
      $this->authorize();
      $this->db->get('members');
       $username = $this->input->post('username', true);
    $password = $this->input->post('password', true);
    if($username || $password)
    {
      if($this->erkanaauth->try_login(array('username' => $username, 'password' => $password)))
        redirect('homepage');
    }
    
    $this->load->view('test_view');
  }

  function logout()
  {
    $this->erkanaauth->logout();
    redirect('','Homepage');
  
  }
  
  private
  function authorize()
  {
    if($this->erkanaauth->try_session_login())
        return true;
  
    redirect('gallery/login');
  }
      
}
?>


but I get a Redirect Loop error and I am not sure why?


Messages In This Thread
user login - by El Forum - 04-27-2009, 07:35 AM
user login - by El Forum - 04-27-2009, 07:44 AM
user login - by El Forum - 04-27-2009, 07:44 AM
user login - by El Forum - 04-27-2009, 07:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB