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 \" < http-equiv=refresh content= \'0; url=http://localhost:8000/php/index.php \'> \";
// header( \"Location:index.php \");
// break;
echo \'ok2 \';
}
?>
html代码:
<html>
<head> </head>
<body>
<form action= \'xajaxtest.php \' method= \'POST \'>
<input type= \'hidden \' name= \'test \' value= \'test1 \'>
<input name= \'submit1 \' type= \'submit \' value= \'submit1 \' = \'submit1 \'>
<input name= \'submit2 \' type= \'submit \' value= \'submit2 \' = \'submit2 \'>
</form>
</body>
</html>
为什么 这个测试页面 载入后第一次不传数据?
echo $_POST[ \'submit1 \'];echo $_POST[ \'submit2 \'];都打印空
之后就好了。这个是什么原因 有没有办法解决?
方法二:
< language= \" \"><!--
function check(){
frm.action = \"checkname.php \"
}
function mysubmit() {
frm.action = \"zhuce.php \"
}
// --></ >
<form method=post action= \" \" name= \"frm \">
<input type= \"submit \" = \"check() \">
<input type= \"submit \" = \"mysubmit() \">
</form> 继续阅读与本文标签相同的文章
下一篇 :
2019年安卓应用的7大漏洞类型
-
华为打回欧洲市场!HMS取得重大成功,大量APP接入!谷歌慌不慌?
2026-05-14栏目: 教程
-
PS保存图片提示“无法完成请求”,这里有4种解决方法!
2026-05-14栏目: 教程
-
想买1000元左右的5G手机?我们需要等多久?
2026-05-14栏目: 教程
-
剧情反转?美企主动购买华为5G技术,华为成赞赏排行榜第一名!
2026-05-14栏目: 教程
-
城市数字化后,新一代内生安全系统可全方位保护
2026-05-14栏目: 教程
