Re: Two websites need to share part of one database, suggestions please

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx> wrote:
> André Medeiros <mailto:andre.caum@xxxxxxxxx>
>     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.
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux