如何将值发布到多PHP页面? [英] How to post value to multi php page?
问题描述
输入按钮在index.php中
the input button is in index.php
<form method="post" action="1.php,2.php,3.php">
<input type="text" name="search" id="search" class='search'/>
<Input type="image" src="" value="Search" class="search_button" /><br />
</form>
我想设置一个搜索框并将值发布到3页.经过一个过程,这三个页面将获取值并自行运行
I want to set a search box and post a value to 3 pages. The 3 pages get the values and run themselves, after a process,
-
1.php生成1.jpg,
1.php generate 1.jpg,
2.php生成2.jpg,
2.php generate 2.jpg,
3.php生成3.jpg.
3.php generate 3.jpg.
然后index.php等待生成3张图像,然后进行回显,显示 3张图片.
Then index.php waiting 3 images generated, then make a echo, show the 3 images.
该怎么做?谢谢.
推荐答案
您不能使用标准HTML表单以这种方式将请求发送到三个不同的页面.表单旨在将HTTP请求仅发送到一个位置.
You cannot use standard HTML forms to send requests to three different pages in this way. A form is designed to send an HTTP request to only one location.
理想情况下,您将有一个target.php
文件,然后通过include
在服务器上调用文件1.php
2.php
和3.php
,合并结果,并将其发送回用户.
Ideally, you would have a single target.php
file which then calls files 1.php
2.php
and 3.php
on the server through include
, merges the results, and sends them back to the user.
如果失败(例如,某些文件位于不同的服务器上),则可以使用重定向:1.php
完成后重定向到2.php
,依此类推.
Failing that (for instance, some of the files are on different servers), you could use redirection: 1.php
redirects to 2.php
when it's done, and so on.
这篇关于如何将值发布到多PHP页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!