|
Posted by pangea33 on 12/16/06 21:23
Your Name wrote:
> All,
>
> I volunteered for a church project whereby I need my PHP page to send
> off a HTTP request to third party web site that provides a service.
> That service sends back a small XML file of information. My PHP page
> should capture that response, parse the XML, and display the information
> received.
>
> I spent probably hours looking through the function list and still have
> not determined which package does what I need. There's the http package
> that seems like is what I need for my page to send out the request, but
> there are no examples and very little documentation on using these tools
> (on php.net)...
>
> Then, how do I capture the data stream sent back from that remote
> website? Is that part of the http package, too, or do I need something
> else?
>
> I'm confident I can use domxml_xmltree() to parse the string I get back
> into something more useable...
>
> I probably don't need a dissertation on how to do it, but just a gentle
> nudge to point me to the basic packages I need to dig into more deeply.
> But if you want to send a dissertation, I'd be delighted at what I
> could learn!
>
> Mark
Can you provide some info about what you want to do in terms of user
interface? Do you want to execute the call and parse the returned
content when a user clicks something, or do you want to run this
periodically as a system process?
The first would be an example like returning a weather forecast when a
user enters a zipcode, and would best be implemented using something
like an AJAX request that is launched by a user. You could send the
request directly to the other site, and then process the response.
The second might be something like grabbing the days postings from a
forum, which would be saved locally once per night. This would likely
use a cron entry to fire off a php page that could handle data returned
from the target website through the use of CURL,
Navigation:
[Reply to this message]
|