简体   繁体   English

从第三个PHP页面获取GET / POST结果

[英]Getting GET/POST result from third PHP page

I have the following pages: 我有以下页面:

  • webservice.php - it has a webservice used to handle all the possible GET and POST variables sent to it, returning a string as result. webservice.php-它具有用于处理发送给它的所有可能的GET和POST变量的Web服务,结果返回一个字符串。
  • form_page.php - the page with a form whose action redirects to table_result.php . form_page.php-具有表单的页面,其动作将重定向到table_result.php
  • table_result.php - on this page, there is a table which should be filled up with the results from webservice.php . table_result.php-在此页面上,有一个表格,该表格应使用webservice.php的结果填充。

My question is: if the GET/POST variables' values are only available on table_result.php (after the form data has been submitted), how can I send them to webservice.php and get the result to fill up the table without leaving table_result.php ? 我的问题是:如果GET/POST变量的值仅在table_result.php上可用(提交表单数据后),我如何将它们发送到webservice.php并获得结果以填满表而不离开table_result .php IT is important to note that on webservice.php there are a bunch of if (isset($_GET["var_name"])) to formulate a database query and return the result on a string, as said before. 重要的是要注意,在webservice.php上,有一堆if (isset($_GET["var_name"]))用于制定数据库查询并以字符串形式返回结果,如前所述。

Thanks in advance. 提前致谢。

First, instead of the $_GET , use $_REQUEST , as this would make it available via both POST and GET. 首先,使用$_REQUEST代替$_GET ,因为这将使它既可以通过POST也可以通过GET使用。 Then you can just use the search here and find your answer 然后,您可以在这里使用搜索找到答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM