2

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.
  • form_page.php - the page with a form whose action redirects to table_result.php.
  • table_result.php - on this page, there is a table which should be filled up with the results from 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? 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.

Thanks in advance.

Steven Liao
  • 3,577
  • 3
  • 19
  • 25
Claudio Eddy
  • 93
  • 1
  • 7
  • 1
    Possible duplicate of http://stackoverflow.com/questions/871858/php-pass-variable-to-next-page – losthorse Sep 24 '13 at 15:41
  • 1
    This question could help: http://stackoverflow.com/questions/3080146/post-data-to-url-php – Michas Sep 24 '13 at 15:49
  • I am not understanding your use case. If you are having the form submitted and actually doing a page redirection, why do you require a web service call at all? Why would you not just get the information needed as part of of the initial page load on `table_result.php`? – Mike Brant Sep 24 '13 at 15:59
  • losthorse, The link provided as possible duplicate only shows the classical get/post operations. MikeBrant, I needed to do that because I must use this web service page through which I may access the system information. It receives post or get variables and returns an answer upon their values. @Michas Your suggestion solved the problem. Thanks! Actually, an answer below the green-checked one shared the link '[how to submit a form using php](http://thehungrycoder.com/general/how-to-submit-a-form-using-php-curl-fsockopen.html)' which I followed step-by-step to solve it. – Claudio Eddy Sep 25 '13 at 02:40

1 Answers1

1

First, instead of the $_GET, use $_REQUEST, as this would make it available via both POST and GET. Then you can just use the search here and find your answer

Steven Liao
  • 3,577
  • 3
  • 19
  • 25
BrixSat
  • 43
  • 5