表单中的多个页面 [英] Multiple Pages in a Form

查看:107
本文介绍了表单中的多个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近为一个内容,图像和页面很少的客户建立了一个简单的网站.现在,他们希望在他们的网站上使用一种表单(非常复杂).我仅使用Bootstrap建立了他们的网站,因此,HTML,CSS和PHP的基础知识就足够了.但是,我想不出一种构建这种形式的方法.

I recently built a simple website for a client having very little content, images and pages. Now, they want a form (a very complicated) one on their website. I built their website using just Bootstrap, so, basics of HTML, CSS and PHP was enough. But, I can't figure out a way of building this form.

这是表格应该做的:

首页

First Page

显示表单字段,以使用户输入其姓名,电话号码和电子邮件地址.然后,使用提交按钮将其带到下一页.

Shows form fields to have user enter their Name, Phone Number and Email address. Then, a submit button takes them to next page.

第二页

Second Page

具有一个下拉列表,其中列出了制造商的名称.根据选择的制造商,另一个列表使您可以选择产品.最后的下拉列表使您可以选择型号.

Has a dropdown list with names of manufacturers. Depending on the manufacturer chosen, another list lets you choose a product. A final dropdown list lets you select the model number.

第三页

Third Page

此页面应该显示所选型号所独有的内容.例如,如果在上一页中选择了"Model X",则此页面将显示一组唯一的字段.选择模型Y",您将获得不同的字段集.

This page, is supposed to show content unique to the model number chosen. For example, if "Model X" was selected in the previous page, this page displays a unique set of fields. Choose "Model Y" and you get a different set of fields.

稍后我将弄清楚如何将所有这些存储到数据库中.但就目前而言,如果您能帮助建立此表格,我将不胜感激.

I will figure out later how to get all this stored into the database. But for now, I would really appreciate it if you can help build this form.

推荐答案

您可以使用GET和POST方法处理变量,也可以将变量保存在SESSION中.

You can handle the variables with GET and POST methods also you can save variables in SESSION.

因此,何时可以在链接页面中处理此变量.在您的表单中,您可能会使用隐藏的输入来再次发送另一个页面来再次处理此变量.在该过程结束时,您可以更新或将一个或多个实体保存在数据库中.

So, when you can handle this variables in the chaining pages. In your forms you might use hidden inputs to send again another page to handle this variables again. At the end of the process you can updat or save your entity or entities in your database.

这篇关于表单中的多个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆