CodeIgniter Forums
callback - looping or happening twice! Please help!!! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: callback - looping or happening twice! Please help!!! (/thread-6755.html)



callback - looping or happening twice! Please help!!! - El Forum - 03-10-2008

[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');
        }
        
    }



callback - looping or happening twice! Please help!!! - El Forum - 03-10-2008

[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...


callback - looping or happening twice! Please help!!! - El Forum - 03-11-2008

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