JSON of weatherRequest is recovered in PHP

This commit is contained in:
Divlo
2019-10-04 13:47:32 +02:00
parent 53db5b80b3
commit 108295322f
8 changed files with 36 additions and 73 deletions

8
php/getWeatherJson.php Normal file
View File

@ -0,0 +1,8 @@
<?php
include 'keyVariable.php';
ini_set("allow_url_fopen", 1);
$cityName = $_COOKIE['city'];
$url = 'https://api.openweathermap.org/data/2.5/weather?q='.$cityName.'&lang=fr&units=metric&appid='.$apiWeather;
$json = file_get_contents($url);
// $obj = json_decode($json);
echo $json;