|
Posted by Andrι Medeiros on 07/12/05 01:07
XML is quite easy. Let's say you're making a search for books, and you
have site1.com searching site2.com for some stuff.
site2.com could have some sort of "back end" like
http://site2.com/_backend/search.php?keywords=a+book
That would search it's database for the keywords "a book".
It could generate XML like:
<searchResults>
<searchResult>
<id>1</id>
<bookTitle>A Children's Book</bookTitle>
</searchResult>
<searchResult>
<id>2</id>
<bookTitle>A Book about Everything!</bookTitle>
</searchResult>
</searchResults>
To do this request, PHP has the fopen command, that will allow you to
read from URLs too (see http://pt.php.net/fopen).
After reading the XML code into a string, just parse it. There are
hundreds of classes on phpclasses.org. Just take a pick :)
I hope this was helpful. If you need me to explain something more
thoroughly, let me know.
Good luck :)
On 7/11/05, Chris W. Parker <cparker@swatgear.com> wrote:
> AndrΓ© Medeiros <mailto:andre.caum@gmail.com>
> on Monday, July 11, 2005 12:44 PM said:
>
> > What about using web-services (something ala xml?). Could that be
> > considered an option?
>
> No because I don't how to use that stuff. :)
>
>
> Chris.
>
Navigation:
[Reply to this message]
|