色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php 多個(gè)submit提交表單 處理方法

test.php
復(fù)制代碼 代碼如下:
<?php
$test = $_POST[ 'test '];
echo '12 ';
echo $test;
echo $_POST[ 'submit1 '];
echo $_POST[ 'submit2 '];
if (isset($_POST[ 'submit1 ']) && $_POST[ 'submit1 '] == 'submit1 ')
{
echo 'ok1 ';

}
if (isset($_POST[ 'submit2 ']) && $_POST[ 'submit2 '] == 'submit2 ')
{
// echo " <meta http-equiv=refresh content= '0; url=http://localhost:8000/php/index.php '> ";
// header( "Location:index.php ");
// break;
echo 'ok2 ';
}
?>


復(fù)制代碼 代碼如下:
<html>
<head> </head>
<body>
<form action= 'xajaxtest.php ' method= 'POST '>
<input type= 'hidden ' name= 'test ' value= 'test1 '>
<input name= 'submit1 ' type= 'submit ' value= 'submit1 ' title= 'submit1 '>
<input name= 'submit2 ' type= 'submit ' value= 'submit2 ' title= 'submit2 '>
</form>
</body>
</html>
為什么 這個(gè)測(cè)試頁面 載入后第一次不傳數(shù)據(jù)?
echo $_POST[ 'submit1 '];echo $_POST[ 'submit2 '];都打印空
之后就好了。這個(gè)是什么原因 有沒有辦法解決?
方法二:
<script language= "JavaScript "><!--

function check(){
frm.action = "checkname.php "
}
function mysubmit() {
frm.action = "zhuce.php "
}
// --></script>
<form method=post action= " " name= "frm ">
<input type= "submit " onclick= "check() ">
<input type= "submit " onclick= "mysubmit() ">
</form>

php技術(shù)php 多個(gè)submit提交表單 處理方法,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 蒲城县| 无棣县| 南投县| 务川| 雷波县| 芷江| 宁晋县| 泰顺县| 仁化县| 肥城市| 罗江县| 罗平县| 琼海市| 靖江市| 盈江县| 石河子市| 黄浦区| 喀什市| 那曲县| 当雄县| 南漳县| 海淀区| 静宁县| 九龙坡区| 罗定市| 威宁| 固始县| 临城县| 高密市| 吉木乃县| 庆云县| 白银市| 和龙市| 凤阳县| 青田县| 富锦市| 甘孜| 新民市| 永年县| 曲沃县| 常州市|