Reply to Re: newbie: XML and Ajax (Google Map)

Your name:

Reply:


Posted by OmegaJunior on 02/01/07 10:27

Hi Jeff!

"Stored on the server" is a broad term. You can similate this, and it wi=
ll =

work as desired. Let me explain:

Say you create a file named geolocations.php.
In that file you create your script to retrieve the wanted geo locations=
.. =

You'll probably want to hand it some parameters so you could call it lik=
e =

this:

geolocations.php?id=3D5&lat=3D41&lng=3D-97&zoom=3D10

then using the $_GET variables to read the parameters and use them in yo=
ur =

sql query.

Then from the result of your query, you build your xml file. Fastest way=
=

to do this as far as I've seen is to create it yourself, using plain tex=
t.

Then this xml file will be the output of your page, just like you'd outp=
ut =

an html page using php, which means that you can use the call to =

geolocations.php directly in the javascript that handles the xml file. =

Don't forget to send a content header, like header('Content-type: =

application/xml') or header('Content-type: text/plain').

I've done this with a none-xml file to query for locations that near a =

given location.

Hope this helps!



On Tue, 30 Jan 2007 14:39:17 +0100, Jeff =

<it_consultant1@hotmail.com.NOSPAM> wrote:

> Hey
>
> I'm developing a web site using PHP 5.2.0 and MySql5.
>
> Now I'm trying to implement Google Map into the web site. My problem =

> here is
> that this ajax service wants the Geo Locations sent in a xml format...=

>
> Lets say this is the select
> select lattitude, longitude from location where id =3D 1;
>
> The result of that select is what I want converted into a xml format a=
nd
> then sent to the requesting ajax service....
>
> All the examples I've read about this subject are using a flat xml fil=
es
> stored on the server... but that is no good solution.. -> I want the x=
ml =

> to
> be dynamically generated and sent over to the requesting ajax service.=
... =

> I
> don't know how to generate such a xml output of a database select..
>
> Any suggestions?
>
> Jeff
>
>



-- =

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

[Back to original 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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация