I have tried as you suggested but am not sure if I understand
correctly.
looking at the result of using (dirn.getDistance().meters) I am still
getting the html as well as the distance!
also i am a bit confused as I have used
GDownloadUrl("callback_miles.php?distance="+ dist,callbackFunction);
On the callback_miles.php page I have just used "$val =
$_GET['distance'];
echo "the distance is: $val";
I am a bit lost, do I need to wtite a call back function ?
Thanks for your time on this, am starting do get a bit desparate
John
On Sep 2, 5:43 pm, "warden [Andrew Leach - Maps API Guru]"
<[EMAIL PROTECTED]> wrote:
> On Sep 2, 5:26 pm, JohnPru <[EMAIL PROTECTED]> wrote:
>
> > I am trying to use the code below which works fine but I need to pass
> > just the actual distance i.e. "8.3" to a php variable so I can use it
> > to charge for delivery on a price per mile basis, I do not want
> > anything written to the screen!
>
> Instead of using dirn.getDistance().html to get the distance, use
> dirn.getDistance().meters. Note the spelling. That returns just a
> number, which you can convert to miles if you need to.
>
> You can then use GDownloadUrl() to pass that number to a server
> script.
>
> var dist = dirn.getDistance().meters;
> GDownloadUrl("myscript.php?distance="+dist,callbackFunction);
>
> The callback function could do nothing or could process any output
> from the php script.
>
> Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---