Get Any METAR Form

Hi All,

Just thought this would come in handy basically the user enters the ICAO then the metar will display in an iframe,

Preview:

When no ICAO entered:

When an ICAO code has been entered (EGKK)

<form action="weather" method="post">
Get METAR For:
 <input type="text" name="icao" />
 <input type="submit" />
</form>

Latest METAR:
<iframe src="http://www.vatsim.net/data/metar.php?id=<?php echo $_POST["icao"]; ?>" class="metar" width="200" height="75" frameborder="0" scrolling="no">></iframe>

Kind Regards,

Jon

Very good, congratulations this helps!

It is possible for a calculator for distances like this site?

For when the pilot to calculate the distance you see the result with the map, in the form of iframe?

It would be very helpful, thanks!

http://www.interkultur.de/gossmann/fsx/circle.php

No problem mate, glad to help

I’ll have a look when I’ve finished a new module for my va.

Kind regards,

Jon

hey guys,

happy newyear !!

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.

Any ideas?

I don’t like the iframes. That’s why I use this:

<?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.

I don’t like the iframes. That’s why I use this:

<?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.

[![post-2881-085226500 1325763772_thumb.jpg](<fileStore.core_Attachment>/monthly_01_2012/post-2881-085226500%201325763772_thumb.jpg)](<fileStore.core_Attachment>/monthly_01_2012/post-2881-085226500%201325763772.jpg)

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.

Hi,

In what tpl did you change it?

I don’t like the iframes. That’s why I use this:

<?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.

I use this script in my briefings, so schedule_briefing.tpl.

If you want it in that, use:

<?php
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";
}

echo get_metar($schedule->depicao);
echo "</br>";
echo get_metar($schedule->arricao);
?>

Thank you very much itrobb, for help, so also is possible to put this information over schedule_details.tlp?

I will visit now your site to see.

bruno

itrobb

I use this script in my briefings, so schedule_briefing.tpl.

If you want it in that, use:

<?php 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"; } echo get_metar($schedule->depicao); echo "
"; echo get_metar($schedule->arricao); ?>

Yes.

You won’t see it on my site however, you can’t see my briefings.

Have a look my metar http://enterairva.pl/ main page on right side

I’d be grateful if you could share with me your code for the metar pullout.

I’d be grateful if you could share with me your code for the metar pullout.

Sorry m8 i cant that was made just for us and wasent free i can talk with my friend and ask him. Pm me with contact details.

can i get one where i manually put the ICAO in a text box

Hey can any one help me i want to display the metar in frontpage_main ?!