|
Posted by Rik on 12/16/06 21:41
pangea33 wrote:
> 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.
Use cURL:
http://www.php.net/manual/en/ref.curl.php
>> 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.
Well, as you indeed state later one of the several XML packages. DOM, DOM
XML, XML, all possibilities. It depends what's possible on the server and
what suits your needs.
>> 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?
cURL is all that is needed to get the information. When in doubt, try to
inspect the headers sent to and from a site when trying to get the XML
manually, and mimique this in cURL.
For parsing the returned XML you have loads of options, even 'by hand' if
it's a very small file.
--
Grtz,
Rik Wasmus
[Back to original message]
|