Welcome Guest, Not a member yet? Register   Sign In
erkana auth - headers already sent
#1

[eluser]pieter dekker[/eluser]
Hi!

I've a problem with de erkana auth library. When you filled in the right username and password I got a 'header already sent' error. But I don't understand why that is. This is my code:

De form is pointing to validatelogin:
Code:
function validatelogin()
    {
        $rules['gebruikersnaam'] = "required";
        $rules['wachtwoord'] = "required";
        $this->validation->set_rules($rules);
        
        $gebruikersnaam = $this->input->post('gebruikersnaam');
        $wachtwoord = $this->input->post('wachtwoord');
        
        if($this->validation->run()==False)
        {
            $this->load->view('login_loader');
        }
        else
        {
            $this->checklogin($gebruikersnaam, $wachtwoord);
        }
    }

Then if the validation is passed, you go to checklogin:

Code:
function checklogin($gebruikersnaam, $wachtwoord)
    {
        if($this->erkanaauth->try_login(array('gebruikersnaam' => $gebruikersnaam, 'wachtwoord' => $wachtwoord)))
        {
            redirect('overzicht');
        }
        else
        {
            $this->load->view('login_loader');
        }
    }

Then if the username and password are correct, I got a 'header already sent' error.

Can someone help me out?
#2

[eluser]gtech[/eluser]
I am guessing that html output is being sent to the browser before the redirect..

1st thing to check... Are there spaces outside the <?php .. ?> bits, if so that causes the headers error..

If that is not the problem then you could try to comment out code to see which line causes the headers to be sent. For example an echo before a redirect will cause the headers error
#3

[eluser]pieter dekker[/eluser]
Tnx for your reaction!

The 'dutch translation pack' was the problem. At the end of the files, after the ?> was an empty line.




Theme © iAndrew 2016 - Forum software by © MyBB