Home > Backend Development > PHP Tutorial > PHP multi-step implementation method to fill in the voting survey form_PHP tutorial

PHP multi-step implementation method to fill in the voting survey form_PHP tutorial

WBOY
Release: 2016-07-13 16:56:25
Original
993 people have browsed it

This article introduces the implementation method of filling in the voting survey form in multiple steps in PHP. It is roughly as follows: After obtaining the content filled in by the user, it is stored in a hidden place, and then the last step is submitted to the database at once.

1.php

 代码如下 复制代码

基本信息1:
基本信息2:

2.php

 代码如下 复制代码

产品名称:
产品价格:
产品型号:



3.php

The code is as follows
 代码如下 复制代码


其他信息1:
其他信息2:
/>
/>
/>
/>
/>

Copy code

 代码如下 复制代码

$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 "写入完成";
?>


Other information 1:
Other information 2:
/>
/>
/>
/>
/>

4.php

The code is as follows Copy code
$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 "Writing completed";
?> Summary The problem with this approach is that if the user accidentally closes the page data, the data will have to be filled in again. However, this method is used by many large websites, including the novice upgrade in Baidu's encyclopedia.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631595.htmlTechArticleThis article introduces the implementation method of filling in the voting survey form in multiple steps in PHP, which is roughly to obtain the content filled in by the user. Then save it in a hide, and then submit it to...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template