CodeIgniter Forums
Using post data in a second view - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Using post data in a second view (/showthread.php?tid=52866)



Using post data in a second view - El Forum - 06-30-2012

[eluser]ozy123[/eluser]
Hellooo,

I have a process which passes through a chain as below:

controller-> view -> controller -> view -> controller -> database search using post data

In the first view I have a form which submits data. In the final controller using $this->input->post() I can't retrieve the data - should I save it to an array in the second controller and pass it along?

Ta!


Using post data in a second view - El Forum - 06-30-2012

[eluser]pickupman[/eluser]
If you are needing to pass/save data for more than one page request, it is best to store it in a users session. Common example, someone uses a search. The form is posted to the controller, save the search in the users session, and load the search results. Using pagination to show more than one page of search results will require the server to know what the original search was for.