Home php教程 php手册 php分多步填写投票调查表单实现方法

php分多步填写投票调查表单实现方法

May 25, 2016 pm 04:55 PM

本文章介绍了关于php分多步填写投票调查表单实现方法,大致为 把用户填写的内容获取之后保存在一个隐藏中,然后最后一步就一次提交给数据库。

1.php

 代码如下 复制代码

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

2.php

 代码如下 复制代码

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



3.php

 代码如下 复制代码


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

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

总结

这种做的问题在于如果用户不小心关闭了页面数据将要重新再填写一次哦,不过这种方法很多大型网站都是这样做的,包括百度的百科里面的新手升级也是这样处理的。



本文地址:

转载随意,但请附上文章地址:-)

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)