CodeIgniter Forums

Full Version: callback - looping or happening twice! Please help!!!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]nevsie[/eluser]
I am running the callback and originally it was sending an mail which started arriving twice. Simplfying it down... it appears to only be occuring through the callback i am making... not sure why, but hopefully someone can spot the obvious i am missing!!!

Code:
function forgotten()
    {
        $this->load->library('validation');
        
        $fields = array('email' => 'Email Address');
        $this->validation->set_fields($fields);
        
        $rules = array('email' => 'required|callback_email');
        $this->validation->set_rules($rules);
        
        $this->validation->set_error_delimiters('<div class="error">', '</div>');
        
        if ($this->validation->run() == FALSE)
        {
            $this->load->view('login/forgotten');
        }
        else if ($this->validation->run() == TRUE)
        {
            $this->session->set_flashdata('message', 'success and redirected');
            redirect('login/login');
        }
        
    }

El Forum

[eluser]nevsie[/eluser]
sorry being a spanner!!! i am running and if and else if, therefore doing the validation twice and i did not see it... fool...

El Forum

[eluser]wiredesignz[/eluser]
Having a spanner in the forums is better than all the loose nuts we normally get. :lol: