Question

I am a newbie with zend. On the web-site i am building using zend/php, people can come and write a review. By default, we allow user to write a review without checking if the user is registered, but before submitting we ask them to either login or create a account(deliberate strategy so that more people write review). In those cases i need to keep the data entered by the user intact to be entered into our database just after login. How do i do that?

One way I can think of is to store all the user entered data into session variables. Are there are more smart/intelligent or accepted ways to do this ?

Was it helpful?

Solution

As you have mentioned, the very first thing that comes to mind is using the SESSION variable. The only thing I can add which I would recommend is to use the Zend_Session_Namespace class to store the data so that your data doesn't get currupted in any way. Cheers.

Another Option

You could use javascript/ajax also.

When the user is about to submit the form, you hide the form using javascript and load the accout creation form. You can then submit via ajax. In that case the form data is still available on the page...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top