国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > PHP > 正文

PHP分多步驟填寫發布信息的簡單方法實例代碼

2024-05-04 23:13:50
字體:
來源:轉載
供稿:網友
1.php

復制代碼 代碼如下:


<form name=form1 id=form1 method=post action=2.php>
基本信息1:<input type=text name=base1 />
基本信息2:<input type=text name=base2 />
<input type=submit value="下一步">
</form>


2.php

復制代碼 代碼如下:


<form name=form2 id=form2 method=post action=3.php>
產品名稱:<input type=text name=prcname />
產品價格:<input type=text name=price />
產品型號:<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=下一步 />
</form>


3.php

復制代碼 代碼如下:


<form name=form3 id=form3 method=post action=4.php>
其他信息1:<input type=text name=other1 />
其他信息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=確定 />
</form>


4.php

復制代碼 代碼如下:


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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 蓬安县| 全州县| 龙岩市| 庆阳市| 辽阳县| 桃园市| 遂平县| 乌海市| 卢氏县| 芦山县| 博乐市| 岳阳县| 渑池县| 阿鲁科尔沁旗| 开平市| 泰州市| 安义县| 宁夏| 三江| 司法| 嵊泗县| 建湖县| 若尔盖县| 广水市| 墨江| 晋江市| 揭西县| 东乡县| 肇庆市| 义乌市| 横峰县| 永康市| 新巴尔虎右旗| 孝感市| 十堰市| 石泉县| 静乐县| 尉氏县| 安陆市| 安徽省| 涟水县|