Home  >  Article  >  Backend Development  >  一个简单的表单提交,然后返回提交页面,需要相应数据解决方法

一个简单的表单提交,然后返回提交页面,需要相应数据解决方法

WBOY
WBOYOriginal
2016-06-13 13:40:19852browse

一个简单的表单提交,然后返回提交页面,需要相应数据
test3.php:















Enter













test4.php:

$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();
<br><font color="#e78608">------解决方案--------------------</font><br>数组不是同样的道理? 关键你要怎么显示?
<br><font color="#e78608">------解决方案--------------------</font><br>test4.php:<br><br><?php <br />$brand = $_REQUEST["brand"];<br>$model = $_GET["model"];<br>$years = $_GET["years"];<br>$a = array($brand,$model,$years);<br><br>include 'test3.php';<br>?><br><br><br>test3.php<br>...<br><input type="text" name="querybuilder" id="querybuilder" value="<?php echo join(',', $a) ?>"><br>... <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn