You are here: Re: [PHP] Two websites need to share part of one database, suggestions please « PHP « IT news, forums, messages
Re: [PHP] Two websites need to share part of one database, suggestions please

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]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация