CodeIgniter Forums
Re-populate forms after clicking away with $_SESSION data - 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: Re-populate forms after clicking away with $_SESSION data (/showthread.php?tid=45678)



Re-populate forms after clicking away with $_SESSION data - El Forum - 09-30-2011

[eluser]Unknown[/eluser]
I have a chain of forms as part of one single process, separate views. Once you $_POST and leave the first view to go to the second view, if you want to let the user "go back" to the first view, there's no way to re-populate the data since the $_POST doesn't exist anymore.

Something like this...

Code:
Form1 -> Form2 -> Form3 -> ThankYouPage

$_SESSION seems like the best option to make this data available in a historical fashion, but my forms are built using the set_value() functions in CI, so I prefer to find a way to re-populate the forms based on data stored in $_SESSION if possible.

Everything's working with the re-population functions that use $_POST, but as soon as I move them along to the other part of the process, $_POST disappears (as I would expect). Doing this somehow with a session seems the only option I think...just not sure how, yet.

Thanks for replies. Been banging my head against the wall with this one :-)