Welcome Guest, Not a member yet? Register   Sign In
Best method for sending form variables to a model ?
#8

[eluser]ywftdg[/eluser]
Ok, got it working. One thing though, I ended up placing my redirect in the model, is this good form? After it checks the query listed above in my model, it then says either move on, or reload the form. Is it ok to be in the model, or should this be back in the controller after the model is loaded. I ask because I couldn't get it to work in the controller, only in the model like this ->

Code:
function check_emailpassword($data)        {
        $this->load->library('session');
            
        $email = $data['email'];
        $password = $data['password'];
            
           $this->db->select('*');
        $this->db->where('designer.dEmail' , $email);
        $this->db->where('designer.dPassword' , $password);
        $this->db->from('designer');
        $query = $this->db->get();
        
        if ($query->num_rows() > 0) { // REDIRECT
            $this->session->set_userdata('designeremail', $email);
            redirect('designers/account');
        } else    {
            $this->load->view('login_view');
        }
                
       }


Messages In This Thread
Best method for sending form variables to a model ? - by El Forum - 07-22-2007, 03:44 PM
Best method for sending form variables to a model ? - by El Forum - 07-22-2007, 04:41 PM
Best method for sending form variables to a model ? - by El Forum - 07-23-2007, 11:14 AM
Best method for sending form variables to a model ? - by El Forum - 07-29-2008, 12:42 AM
Best method for sending form variables to a model ? - by El Forum - 07-29-2008, 02:26 AM
Best method for sending form variables to a model ? - by El Forum - 07-29-2008, 02:38 AM
Best method for sending form variables to a model ? - by El Forum - 07-29-2008, 02:49 AM
Best method for sending form variables to a model ? - by El Forum - 07-29-2008, 10:35 AM
Best method for sending form variables to a model ? - by El Forum - 11-25-2008, 12:05 PM
Best method for sending form variables to a model ? - by El Forum - 11-25-2008, 12:38 PM
Best method for sending form variables to a model ? - by El Forum - 11-25-2008, 12:50 PM
Best method for sending form variables to a model ? - by El Forum - 11-26-2008, 07:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB