The output of my php is a JSON object (see below). Shouldn't I be able
to just call the php file?

Here is my php code:

<?php
header('Content-Type: text/javascript');
header('Cache-Control: no-cache');
header('Pragma: no-cache');

include('Services/Weather.php');

$metar = &Services_Weather::service("METAR", array("debug" == 0));
if(Services_Weather::isError($metar)) {
        die("Error: ".$metar->getMessage()."\n"); }

$data = $metar->getWeather("CYBW", "Metric");
$icon = $metar->getWeatherIcon($data['condition'], $data['clouds'],
$data['wind'], $data['temperature'],51.083,-114.083);
$fmt = 1;

function chgFmt($flag) {
        $flag = (($flag==0)?1:0);
        return $flag;
}

$value{"Weather"}{0}{"Icon"} = $icon;
$value{"Weather"}{0}{"Condition"} = ucfirst($data['condition']);
$value{"Weather"}{0}{"Temperature"} = $data['temperature']."&deg;C";
$value{"Weather"}{0}{"Humidity"} = $data['humidity']."%";
$value{"Weather"}{0}{"Wind"} = $data['wind']." kph";
$value{"Weather"}{0}{"Clouds"} = $data['clouds'][0]['amount'];

$output = json_encode($value);
print($output);
?>

The output is some variant of this...

{"Weather":[{"Icon":
34,"Condition":"","Temperature":"13&deg;C","Humidity":"76.7%","Wind":"0
kph","Clouds":"few"}]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" 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-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to