0

I have my website example.com and in my site I have a web html form to another site so the results are currently displayed in the other site.

I would like to fetch the results from the other website in PHP or something and display the results in my own website, the problem is that the form must be submited in method=Post so I do not see any way to fetch the result.

Any idea?

here is the html form from my site to the target remote website

<form action="http://consultawebvehiculos.carabineros.cl/index.php" 
name="form1" id="control" method="post">
<input type="hidden" name="accion" value="buscar">
<table id="SEARCH">
<tr><td class="REGISTRATION">
<input name="txtLetras" type="text" class="PLATE" maxlength="2">
</td><td class="SEP">°</td>
<td class="REGISTRATION">
<input name="txtNumeros1" type="text" class="PLATE" maxlength="2">
</td><td class="SEP">°</td>
<td class="REGISTRATION">
<input name="txtNumeros2" type="text" class="PLATE" maxlength="2">
</td></tr></table>
<input type="submit" value="GET RESULT" ></form>
  • Why do you need to get results of `form` from another website? You have access to the `form` data before submitting the `form`. – guest271314 Dec 07 '16 at 01:32

2 Answers2

0

you can use $_POST['name of the input field'] on http://consultawebvehiculos.carabineros.cl/index.php . Code will be something like this :

$txtLetras== $_POST['txtLetras'] ;
 echo $txtLetras ; 
  • Could you please explain and give me an example? Remember the target page I am getting the results from is not my website ... – caradevineros Dec 07 '16 at 00:53
0

Write a server-side (php) script to act as a proxy. It will receive the form input, post it to the external site, receive a response from the external site and display the response.

You can then post to this script (on your server) via ajax and display the response it returns.

References -- PHP + CURL

PHP + curl, HTTP POST sample code?

Passing $_POST values with cURL

Community
  • 1
  • 1
PeterKA
  • 24,158
  • 5
  • 26
  • 48