Rather than having your server write  a file and having the client ask
the fileserver to serve it, the conventional strategy is to have your
server serve the data directly to the client. That should get rid of all
the timing problems. You also gain other advantages, like the ability to
have two users making requests at the same time.

On the server side, you already have
        echo $response;
so just set the MIME type of for the output stream, before that echo
  header("Content-type: text/xml");
and delete all the file handling stuff that follows it.


On the client side you can just do
  GDownloadUrl(xmlproxy.php?type=rainarchive&ME=" + ME + "&DE=" + DE
        + "&YE=" + YE+ "&HE=" + HE, function(data) {


Here's a really, really simple case of such a communication:
   http://econym.org.uk/gmap/example_map11a.htm
It calls a server script that looks like this:
   http://econym.org.uk/gmap/map11.php.txt
The server outputs the XML to the default output stream, like this
   http://econym.org.uk/gmap/map11.php?q=c
And the client code picks it up with GDownloadUrl.

The client code doesn't know or care about the difference between a
conventional file server and a server that runs your own script. You
might think of them differently, but GDownloadUrl just sends the URL and
gets back the data, and that's all the client code cares about.

-- 
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to