when using redirect
you go from one controller or another by this process all post data are destroyed unless you stored them on a session, here is how i do it
$data = array('firstname'=>'fname','lastname'=>'lastname');
// i store data to flashdata
$this->session->set_flashdata('lolwut',$data);
// after storing i redirect it to the controller
redirect('controller/method')
so on your redirected controller you can access it via $this->session->flashdata('lolwut')
note that i am using flashdata
not userdata
, flashdata
destroys itself on the next process.
read more flashdata here SESSION CLASS
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…