1. php
The code is as follows: |
Copy code |
<Form name = form1 id = form1 method = post action = 2.php> Basic information 1: <input type = text name = base1/> Basic information 2: <input type = text name = base2/> <Input type = submit value = "Next"> </Form> |
2. php
The code is as follows: |
Copy code |
<Form name = form2 id = form2 method = post action = 3.php> Product name: <input type = text name = prcname/> Product price: <input type = text name = price/> Product Model: <input type = text name = prcXH/> <Input type = hidden name = base1 value = "<? Php echo $ _ REQUEST ['base1']?> "/> <Input type = hidden name = base2 value = "<? Php echo $ _ REQUEST ['base2']?> "/> <Input type = submit value = next/> </Form> |
3. php
The code is as follows: |
Copy code |
<Form name = form3 id = form3 method = post action = 4.php> Other information 1: <input type = text name = other1/> Other information 2: <input type = text name = other2/> <Input type = hidden name = base1 value = <? Php echo $ _ REQUEST ['base1']?> /> <Input type = hidden name = base2 value = <? Php echo $ _ REQUEST ['base2']?> /> <Input type = hidden name = prcname value = <? Php echo $ _ REQUEST ['prcname']?> /> <Input type = hidden name = price value = <? Php echo $ _ REQUEST ['price']?> /> <Input type = hidden name = prcXH value = <? Php echo $ _ REQUEST ['prcxh']?> /> <Input type = submit value = OK/> </Form> |
4. php
The code is as follows: |
Copy code |
<? Php $ Base1 = $ _ REQUEST ['base1']; $ Base2 = $ _ REQUEST ['base2']; $ Prcname = $ _ REQUEST ['prcname']; $ Price = $ _ REQUEST ['price']; $ PrcXH = $ _ REQUEST ['prcxh']; $ Other1 = $ _ REQUEST ['other1']; $ Other2 = $ _ REQUEST ['other2']; $ Sql1 = "insert into [base_table] (base1, base2) values ('{$ base1}', '{$ base2 }')"; $ Sql2 = "insert into [prc_table] (prcname, price, prcXH) values ('{$ prcname}', '{$ price}', '{$ prcXH }') "; $ Sql3 = "insert into [other_table] (other1, other2) values ('{$ other1}', '{$ other2 }')"; Query ($ sql1 ); Query ($ sql2 ); Query ($ sql3 ); Echo "write complete "; ?> |
Summary
This problem is that if the user accidentally closes the page data, it will be re-filled. However, this method is used by many large websites, this is also the case for new users in Baidu's Encyclopedia.