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

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

Jun 13, 2016 pm 01:40 PM
gt lt option quot

一个简单的表单提交,然后返回提交页面,需要相应数据
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

1

2

3

4

5

6

7

8

9

10

//全局变量页面

//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>?&gt;<br><br><br>test3.php<br>...<br><input type="text" name="querybuilder" id="querybuilder" value="&lt;?php echo join(',', $a) ?&gt;"><br>... <div class="clear">

                  

               

               

         

            </div>

Copy after login
Statement of this Website
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the differences between Huawei GT3 Pro and GT4? What are the differences between Huawei GT3 Pro and GT4? Dec 29, 2023 pm 02:27 PM

What are the differences between Huawei GT3 Pro and GT4?

Fix: Snipping tool not working in Windows 11 Fix: Snipping tool not working in Windows 11 Aug 24, 2023 am 09:48 AM

Fix: Snipping tool not working in Windows 11

How to Fix Can't Connect to App Store Error on iPhone How to Fix Can't Connect to App Store Error on iPhone Jul 29, 2023 am 08:22 AM

How to Fix Can't Connect to App Store Error on iPhone

What does option mean in linux documentation? What does option mean in linux documentation? Mar 07, 2023 am 10:41 AM

What does option mean in linux documentation?

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决

Is watch4pro better or gt? Is watch4pro better or gt? Sep 26, 2023 pm 02:45 PM

Is watch4pro better or gt?

Microsoft is rolling out Windows 11 23H2 build to the release preview channel with Copilot Microsoft is rolling out Windows 11 23H2 build to the release preview channel with Copilot Sep 28, 2023 pm 07:17 PM

Microsoft is rolling out Windows 11 23H2 build to the release preview channel with Copilot

How to optimize iPad battery life with iPadOS 17.4 How to optimize iPad battery life with iPadOS 17.4 Mar 21, 2024 pm 10:31 PM

How to optimize iPad battery life with iPadOS 17.4

See all articles