keep argument in url with codeigniter

67 Views Asked by At

I am probably just not understanding how this really works, but i want to keep the argument in the URL with codeigniter. I have a form that has the url ../dashboard/edit_member/33 where dashboard is my controller and edit_member is my method and 33 is the ID of the member i am editing. So when i hit submit and go through my form validation etc.. i use

public function edit_member($id = NULL) {

    $this->load->library("form_validation");

    $data['member'] = $this->User->get_user($id);

    if($this->input->post('submit')) { 
        if($this->update_profile() == True) { 
            $data['message'] = 'Profile updated';
        } else {
            $data['message'] = 'There was a problem updating your record';
        }
    } 

    $this->load->view("edit_member", $data);        
}

But my issue is when its submitted, it comes back to ../dashboard/edit_member with no id attached to it anymore...

Am i missing something?

Thanks

0

There are 0 best solutions below