Update:

A javascript test page will geocode, I assume this is because
javascript is client side and the computer I'm on wouldn't be blocked:

http://admin2.shopbrazos.com/geocode.html

The PHP test page will not geocode:

http://admin2.shopbrazos.com/geocode-test.php

My coworkers are convinced that it's a code problem, but I'm thinking
it's just because the javascript is client side and thus, the IP of
your PC is being used.  PHP is using the server's IP.

Here is the php code that isn't working right now:

<?
        $mapaddress = '1500 Harvey Rd, College Station, TX';

        $key = "ABQIAAAAvIjEakkmm-EurjFnU5tBTRRJUD9vj8SLOqYRkMQVYd6-
Xn0fFxR9sqKM_MmqaTrAVKAGA8K-UA78Ig";

        $mapaddress = urlencode("$mapaddress");
        $url = "http://maps.google.com/maps/geo?q=$mapaddress&output=xml&key=
$key";
        $page = file_get_contents($url);
        $xml = new SimpleXMLElement($page);

        list($longitude, $latitude, $altitude) = explode(",", $xml->Response-
>Placemark->Point->coordinates);
        $code = $xml->Response->Status->code;
        $coordinates = "$latitude, $longitude, $altitude";

        echo "Address: $mapaddress<br>";
        echo "Coords: $coordinates<br>";
        echo "XML: $xml<br>";
        echo "Status Code: $code<br>";
        echo "Key: $key";
?>
--~--~---------~--~----~------------~-------~--~----~
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