三步订单表,重新填充输入的最佳方式
目前正在为婚礼摄影师制作一份精美的三步订单表,以便客人可以订购照片。
我分三步设置了表格。
1.用户详细信息 2.查看订单 3.确认
如果用户从步骤 2 返回到步骤 1,重新填充表单数据的最佳方式是什么。
我最初想到使用会话将数据传回,尽管我有这样的感觉可能是不正确的。
任何提示都会很棒。
谢谢大家。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会使用会话变量来做到这一点。我们还有什么其他选择?您可以在用户发送到服务器的每个 GET 或 POST 请求中提供这些值,但这并不是一个好主意,我认为。其他选择?您可以暂时使用数据库,而不是将这些值保存在会话变量中。我会继续使用会话变量。
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.