function FetchValue()
{
    if (!empty($_POST["submit"])) {
        $street = $_POST["street"];
        $city = $_POST["city"];
        $state = $_POST["state"];
        $degree = $_POST["degree"];
        echo "<script type='text/javascript'>\n KeepContent('" . $street . "','" . $city . "','" . $state . "','" . $degree . "');\n </script>";
        if (!empty($street) && !empty($city) && !empty($state) && !empty($degree)) {
            $GoogleGeoCode = simplexml_load_file("https://maps.google.com/maps/api/geocode/xml?address=" . $street . "," . $city . "," . $state . "&key=AIzaSyDXJc-HfeU4ZVttzpruI8Q04ZZtzqv4-is");
            $xmlcont = ParseXml($GoogleGeoCode);
            $Url = "https://api.forecast.io/forecast/e0233df5fb8a3299a02c55c843c4d5dd/" . $xmlcont[0] . "," . $xmlcont[1] . "?units=" . $degree . "&exclude=flag";
            CallJson($Url, $degree);
        }
    }
}
Exemplo n.º 2
0
function FetchValue()
{
    if (!empty($_POST["submit"])) {
        $street = $_POST["street"];
        $city = $_POST["city"];
        $state = $_POST["state"];
        $degree = $_POST["degree"];
        echo "<script type='text/javascript'>\n SaveUserInput('" . $street . "','" . $city . "','" . $state . "','" . $degree . "');\n </script>";
        if (!empty($street) && !empty($city) && !empty($state) && !empty($degree)) {
            $GoogleGeoCode = simplexml_load_file("http://maps.google.com/maps/api/geocode/xml?address=" . $street . "," . $city . "," . $state);
            $Location = ParseXml($GoogleGeoCode);
            $Url = "https://api.forecast.io/forecast/e0233df5fb8a3299a02c55c843c4d5dd/" . $Location[0] . "," . $Location[1] . "?units=" . $degree . "&exclude=flag";
            CallJson($Url, $degree);
        }
    }
}