开发者

Three step order form, best way to repopulate inputs

Currently working on a nice three step order form for a wedding photographer, so guests can order pictures.

I've set the form up in 3 steps.

1.user details 2. review order 3. confirmation

What's the best way to repopulate the form data if the user goes开发者_运维知识库 from Step 2 back to Step 1.

I initially thought of using sessions to pass the data back, though I have a feeling this is probably incorrect.

Any tips would be awesome.

Thanks all.


I would do it using the session variable. What other alternatives do we have? You could provide those values in every GET or POST request the user sends to the server, but that's not a really good idea, I think. Other alternatives? Instead of saving those values in the session variable, you could temporarily use a datebase. I would stay with using the session variable.


I ran into this problem on my project. I first started with sessions. I ended up storing them in temporary tables. I clean those tables out after the last submit on the confirmation and then put that data into the permanent tables. To identify a record I just pass an alias back and forth that is fed into a parameterized query that selects their record in the temp tables.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜