最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

php 多個submit提交表單 處理方法

 更新時間:2009年07月07日 14:09:10   作者:  
php中一個多個submit提交表單如何處理(區(qū)分不同的表單提交)
test.php
復制代碼 代碼如下:

<?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 ';
}
?>


復制代碼 代碼如下:

<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>
為什么 這個測試頁面 載入后第一次不傳數(shù)據(jù)?
echo $_POST[ 'submit1 '];echo $_POST[ 'submit2 '];都打印空
之后就好了。這個是什么原因 有沒有辦法解決?
方法二:
<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>

相關文章

最新評論

固阳县| 社旗县| 绥棱县| 卓尼县| 嵊泗县| 苍南县| 类乌齐县| 枝江市| 河南省| 长乐市| 广州市| 四子王旗| 微博| 灵武市| 张家界市| 梓潼县| 龙山县| 德阳市| 临澧县| 冕宁县| 武城县| 峡江县| 林甸县| 岑巩县| 库车县| 屏山县| 丰城市| 德阳市| 和田县| 怀宁县| 于都县| 新河县| 邻水| 甘谷县| 丰台区| 巴林右旗| 宜城市| 色达县| 澄江县| 酒泉市| 清新县|