一个简单的表单提交,然后返回提交页面,需要相应数据
test3.php:
<script type=”text/javascript”>
function clicksearch()
{
var brand = document.getElementById(“brand”).value;
var model = document.getElementById(“model”).value;
var years = document.getElementById(“years”).value;
var querybuilder = document.getElementById(“querybuilder”);
querybuilder.value = brand+’ ‘+model+’ ‘+years;
document.getElementById(“form1”).submit();
}
</script>
<body>
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
III
<!—ecms onclick=”clicksearch();”–>
Enter
test4.php:
<?php
$
2本文来源gao!daima.com搞$代!码网
搞代gaodaima码brand = $_REQUEST[“brand”];
$model = $_GET[“model”];
$years = $_GET[“years”];
$a = array($brand,$model,$years);
?>
现在想取得$a,并且在表单提交页面的
改变value值,值为$a数组里面的元素。
谢谢了
——解决方案——————–
定义一个全局变量,在test3.php提交时赋值,返回时,调用就OK了。
- PHP code
//全局变量页面//ini.php$ini = array();
------解决方案--------------------
数组不是同样的道理? 关键你要怎么显示?
------解决方案--------------------
test4.php:<?php
$brand = $_REQUEST["brand"];
$model = $_GET["model"];
$years = $_GET["years"];
$a = array($brand,$model,$years);include 'test3.php';
?>test3.php
...
">
...