[英]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.