Welcome Guest, Not a member yet? Register   Sign In
Problems with Validation and $data
#1

[eluser]EvanCalkins[/eluser]
I'm being introduced to validation here: http://ellislab.com/codeigniter/user-gui...controller

The problem I am having is when my form returns FALSE and I use $this->load->view('myview.php'); any of the $data
variables that were assigned in the action which originally called myview.php is not passed along and I get Undefined variable errors.

I'm sure this is an easy fix... I am just banging my head against the wall on this one. Any help would be appreciated.

Here is my method:

Code:
function reg_insert()
    {
            
        //Validated Fields
        $this->load->library('form_validation');
        $this->form_validation->set_rules('name', 'Name', 'required');
        
        //Check if Validated
        if ($this->form_validation->run() == FALSE) {
            $this->load->view('camp_submit');
            //redirect('camp');
        }else{
            $this->db->insert('reg', $_POST);
            redirect('camp/show');    
        }
        
    }


Messages In This Thread
Problems with Validation and $data - by El Forum - 12-15-2008, 12:36 AM
Problems with Validation and $data - by El Forum - 12-15-2008, 03:12 AM
Problems with Validation and $data - by El Forum - 12-15-2008, 03:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB