we were trying this code but we get this as reply :
Not Found
The requested URL /weer/weather was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
<?php
$location = "EGLL";
get_metar($location);
function get_metar($location) {
$fileName = "http://weather.noaa.gov/pub/data/observations/metar/stations/$location.TXT";
$metar = '';
$fileData = @file($fileName) or die('METAR not available');
if ($fileData != false) {
list($i, $date) = each($fileData);
$utc = strtotime(trim($date));
$time = date("D, F jS Y g:i A",$utc);
while (list($i, $line) = each($fileData)) {
$metar .= ' ' . trim($line);
}
$metar = trim(str_replace(' ', ' ', $metar));
}
echo "METAR FOR $location (Issued: $time UTC):<br>$metar";
}
?>
You can change the location to <?php echo $schedule->depicao;?> or arricao in the schedule briefing or details. It’s much better than the default METARs in phpVMS because they don’t have to load.
<?php
$location = "EGLL";
get_metar($location);
function get_metar($location) {
$fileName = "http://weather.noaa.gov/pub/data/observations/metar/stations/$location.TXT";
$metar = '';
$fileData = @file($fileName) or die('METAR not available');
if ($fileData != false) {
list($i, $date) = each($fileData);
$utc = strtotime(trim($date));
$time = date("D, F jS Y g:i A",$utc);
while (list($i, $line) = each($fileData)) {
$metar .= ' ' . trim($line);
}
$metar = trim(str_replace(' ', ' ', $metar));
}
echo "METAR FOR $location (Issued: $time UTC): $metar";
}
?>
You can change the location to <?php echo $schedule->depicao;?> or arricao in the schedule briefing or details. It’s much better than the default METARs in phpVMS because they don’t have to load.
We need to have a form attached to enter the ICAO of choice. When I read this correct it only shows a fixed ICAO or the dep/arricao in a scheduled flight.
We need to have a form attached to enter the ICAO of choice. When I read this correct it only shows a fixed ICAO or the dep/arricao in a scheduled flight.
Yes but this is for schedule briefings etcso that the pilot doesn’t need to enter anything.
<?php
$location = "EGLL";
get_metar($location);
function get_metar($location) {
$fileName = "http://weather.noaa.gov/pub/data/observations/metar/stations/$location.TXT";
$metar = '';
$fileData = @file($fileName) or die('METAR not available');
if ($fileData != false) {
list($i, $date) = each($fileData);
$utc = strtotime(trim($date));
$time = date("D, F jS Y g:i A",$utc);
while (list($i, $line) = each($fileData)) {
$metar .= ' ' . trim($line);
}
$metar = trim(str_replace(' ', ' ', $metar));
}
echo "METAR FOR $location (Issued: $time UTC): $metar";
}
?>
You can change the location to <?php echo $schedule->depicao;?> or arricao in the schedule briefing or details. It’s much better than the default METARs in phpVMS because they don’t have to load.