Welcome Guest, Not a member yet? Register   Sign In
How to show a preview / confirmation page before writing the form to the database
#14

[eluser]TheFuzzy0ne[/eluser]
[quote author="JeremyApp" date="1235083398"]Someone correct me if this is a bad way to do it, but I generally use flashdata for this purpose.

Flashdata is a part of the CI session library that stores temporary variables, usually for the next request only (optionally the next two requests). I will usually write the inputted data to flashdata and then display it on the next page. Since it should be valid for another request, I can either choose to write it to the database or discard.

http://ellislab.com/codeigniter/user-gui...sions.html - see "Flashdata"[/quote]

I wouldn't go as far as to say that that's the wrong way to do it, but I tend to see flashdata as being more of a convenience than anything else. I like to keep any data such as payment information away from the user. However, if the data is not of a sensitive nature, I love flashdata, but I only use flashdata in situations that I know the user has cookies enabled. For example, when they are logged in. If they are logged in then they have cookies enabled, if they're not, we can't be sure, so assuming they do might break your application.


Messages In This Thread
How to show a preview / confirmation page before writing the form to the database - by El Forum - 02-19-2009, 10:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB