简体   繁体   English

使表单结果显示在同一页面上,其中数据来自另一个站点

[英]make a form results show on same page where data comes from another site

Ok, I have a unique issue. 好吧,我有一个独特的问题。 I have a real estate wordpress website that uses IDX (Internet Data Exchange) data to show MLS (Multiple Listing Service) listings. 我有一个房地产wordpress网站,它使用IDX(互联网数据交换)数据显示MLS(多重列表服务)列表。 So all the IDX data is stored through my IDX provider's site. 因此,所有IDX数据都是通过我的IDX提供者的网站存储的。 Currently, when a user submits a form, it goes to a results page that is hosted through my idx provider (example: http://www.mysite.idxco.com/idx/my.account#/results.php? ). 当前,当用户提交表单时,它会转到通过我的idx提供程序托管的结果页面(例如: http : //www.mysite.idxco.com/idx/my.account#/results.php? )。 What I am trying to do is create a form which would render the results on the same page....how would I do that? 我想做的是创建一个表单,将结果呈现在同一页面上。...我该怎么做? If I am not being clear enough please let me know. 如果我不够清楚,请告诉我。

If I understand what you mean, you have different options, you can 如果我理解您的意思,您有不同的选择,您可以

1) POST via ajax, and have your hosted page send back html in response that you can show in the same page in a div. 1)通过ajax进行POST,并让您的托管页面发回html作为响应,以便您可以在div的同一页面中显示。 Its very easy to do with jquery. 使用jQuery非常容易。 It might be easier to integrate in a wordpress page, but you need to be able to modify your hosted page. 集成到wordpress页面中可能会更容易,但是您需要能够修改托管页面。

2) you can post to a page on your server (not on the idx provider's), then use curl to send the data you received from your form as a post to the idx provider page, grab the returned html, parse it, get the results, reload the page with your own form along with the results you got from curl. 2)您可以发布到服务器上的页面(而不是idx提供者的页面),然后使用curl将您从表单收到的数据作为帖子发送到idx提供者页面,获取返回的html,对其进行解析,获取结果,以您自己的形式重新加载页面以及从curl获得的结果。

You might need to check with your idx provider if it is ok that you 'scrape' the data. 您可能需要与idx提供程序进行核对,以确定是否可以“擦除”数据。

(Of course if you had a api access which is very likely with idx you can just send a api request, which would be much more efficient ) (当然,如果您具有idx很有可能使用的api访问权限,则只需发送一个api请求,这样效率会更高)

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

相关问题 搜索结果表单以显示另一页 - Search results form to show another page Laravel 4 - 重定向回请求来自的同一页面 - Laravel 4 - Redirect back to the same page where the request comes from 将数据发布到同一站点上的另一个Joomla页面 - POST data to another Joomla page on the same site 表单方法不从html表单返回数据,其中数据来自mysql中的单个列 - Form method not returning data from html form where data comes from a single column in mysql HTML PHP显示表单在同一页面上提交结果 - HTML PHP show form submit results on same page 将数据从视图传递到控制器,其中数据来自另一个控制器 - passing data from the view to the controller, where the data comes from another controller 我们可以使用同一页面中另一种形式的用户输入数据吗 - can we use user input data from one form in another form of same page 表格,使用php从mysql检索数据,并在同一HTML页面中填充另一表格 - Form which retrieves data from mysql using php and fills another form in the same HTML page 如何根据“ where”条件使用外键使自动完成显示来自另一个表的数据 - how to make Autocomplete show data from another table using foreign key according to “where” condition 自动将数据从一种形式填充到另一种形式,托管在另一个站点上 - Autopopulating data from one for to another form, hosted on another site
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM