Redirect on page edit after save - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Redirect on page edit after save (/showthread.php?tid=64404) |
Redirect on page edit after save - webgirl - 02-16-2016 Hi guys am new to the forum I need to create a form that saves the partial data of a form and continues in another step with the same pageId example: load form->save->after save redirect to editpage/pageId this is the first step code, how do I go to the second step to complete the application form with the same pageid? are slightly desperate ... can someone please help me? thank you Code: function step1() RE: Redirect on page edit after save - webgirl - 02-17-2016 nobody?? RE: Redirect on page edit after save - donpwinston - 02-17-2016 I think you're asking how to pass the page_id to the next form. redirect("x\y\$page_id") x is the controller class. y is a function in x. And page_id is the parameter of function y. RE: Redirect on page edit after save - keulu - 02-17-2016 $this->db->insert('data_form',$data); return you the last_insert_id() so you can write $data_form_id = $this->db->insert('data_form',$data); redirect("backend/page/edit/".$data_form_id); [...] method edit in page controller public function edit($data_form_id = null){ if (is_null($data_form_id)){ show_404(); // security } // do you stuff with $data_form_id } |