duanfoumi5620 2010-03-19 14:56
浏览 70

在提交到数据库之前,如何将PHP表单拆分为两个部分?

I have set up a PHP form for a competition for users to enter all information to be stored in a database. I used a NetTut+ tutorial to do so.

I've got the form submitting to the database as required, but with so many additional questions being asked, I would like to split the form into two separate sections. Obviously the first page would say continue to the next step before the second step allowing for the form to be submitted to the database.

The content that the user sees should be split, but should all be a part of the same form. Step 1 > Step 2 before submission.

Would anyone know of or recommend any methods to do this?

I've attached the code below.

<form method="post" action="">

    <fieldset>

        <ul>
            <li>
                <label for="code">Entry Code On-Pack</label>
                <input type="text" name="code" />
            </li>
            <li>
                <label for="name">Name</label>
                <input type="text" name="name" />
            </li>
            <li>
                <label for="email">Email</label>
                <input type="text" name="email" />  
            </li>
            <li>
                <label for="addressone">Address</label>
                <input type="text" name="addressone" />
            </li>
            <li>
                <label for="addressone">&nbsp;</label>
                <input type="text" name="addresstwo" />
            </li>
            <li>
                <label for="addressone">&nbsp;</label>
                <input type="text" name="addressthree" />       
            </li>
            <li>
                <label for="telephone">Telephone</label>
                <input type="text" name="telephone" />  
            </li>
            <li>
                <label for="dob">Date of Birth</label>
                <input name="dob" type="text" value="[dd/mm/yy]" /> 
            </li>
            <li>
                <label for="q1">Where have you seen Cookstown advertised?</label><br />
                <input type="checkbox" name="q1cb1" /><label for="q1cb1">Magazines</label><br />
                <input type="checkbox" name="q1cb2" /><label for="q1cb2">Billboards</label><br />
                <input type="checkbox" name="q1cb3" /><label for="q1cb3">Television</label><br />
                <input type="checkbox" name="q1cb4" /><label for="q1cb4">Radio</label><br />
                <input type="checkbox" name="q1cb5" /><label for="q1cb5">Online</label><br />
                <input type="checkbox" name="q1cb6" /><label for="q1cb6">Public Transport</label><br />
                <input type="checkbox" name="q1cb7" /><label for="q1cb7">Bus Stops</label><br />
            </li>
            <li>
                <label for="q2">How well do you remember those advertisments?</label><br />
                <input type="radio" name="q2" value="VeryWell"/><label for="q1cb1">Very well</label><br />
                <input type="radio" name="q2" value="FairlyWell"/><label for="q1cb2">Fairly well</label><br />
                <input type="radio" name="q2" value="FewDetails"/><label for="q1cb3">A few details</label><br />
                <input type="radio" name="q2" value="NotAtAll"/><label for="q1cb4">Not at all</label><br />
            </li>
                <label for="tc">Do you accept the terms and conditions</label>
                <input type="checkbox" name="tc" class="styled" />
            </li>
            <li>&nbsp;</li>
            <li>
                <input type="submit" value="Enter Competition" class="large blue button" name="signup" />           
            </li>
        </ul>

    </fieldset>

</form> 
  • 写回答

4条回答 默认 最新

  • duandaotuo5542 2010-03-19 14:59
    关注

    Use sessions mechanism to store 1 step data

    评论

报告相同问题?

悬赏问题

  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算