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

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

 更新時(shí)間:2009年07月07日 14:09:10   作者:  
php中一個(gè)多個(gè)submit提交表單如何處理(區(qū)分不同的表單提交)
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è)試頁(yè)面 載入后第一次不傳數(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>

相關(guān)文章

最新評(píng)論

乌兰浩特市| 仁寿县| 利辛县| 红河县| 万盛区| 子洲县| 齐河县| 永福县| 浦城县| 墨竹工卡县| 托克托县| 芦山县| 疏勒县| 孟连| 临安市| 嘉峪关市| 湘潭市| 临颍县| 时尚| 长子县| 宜兰市| 聂拉木县| 会宁县| 济阳县| 唐山市| 辉县市| 芜湖县| 栾川县| 临夏市| 赫章县| 民乐县| 丁青县| 英超| 定兴县| 碌曲县| 望都县| 卢湾区| 彰武县| 池州市| 阿坝县| 怀宁县|