Jon Posted December 2, 2010 Report Share Posted December 2, 2010 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 Quote Link to comment Share on other sites More sharing options...
Kairon Posted December 3, 2010 Report Share Posted December 3, 2010 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 Quote Link to comment Share on other sites More sharing options...
Jon Posted December 3, 2010 Author Report Share Posted December 3, 2010 No problem mate, glad to help I'll have a look when I've finished a new module for my va. Kind regards, Jon Quote Link to comment Share on other sites More sharing options...
druptown Posted January 5, 2012 Report Share Posted January 5, 2012 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? Quote Link to comment Share on other sites More sharing options...
freshJet Posted January 5, 2012 Report Share Posted January 5, 2012 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. Quote Link to comment Share on other sites More sharing options...
druptown Posted January 5, 2012 Report Share Posted January 5, 2012 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. 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. Quote Link to comment Share on other sites More sharing options...
freshJet Posted January 5, 2012 Report Share Posted January 5, 2012 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. Quote Link to comment Share on other sites More sharing options...
bteixeira Posted February 18, 2014 Report Share Posted February 18, 2014 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):<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. Quote Link to comment Share on other sites More sharing options...
freshJet Posted February 18, 2014 Report Share Posted February 18, 2014 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); ?> Quote Link to comment Share on other sites More sharing options...
bteixeira Posted February 24, 2014 Report Share Posted February 24, 2014 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):<br>$metar"; } echo get_metar($schedule->depicao); echo "</br>"; echo get_metar($schedule->arricao); ?> Quote Link to comment Share on other sites More sharing options...
freshJet Posted February 25, 2014 Report Share Posted February 25, 2014 Yes. You won't see it on my site however, you can't see my briefings. Quote Link to comment Share on other sites More sharing options...
Kapitan Posted February 28, 2014 Report Share Posted February 28, 2014 Have a look my metar http://enterairva.pl/ main page on right side Quote Link to comment Share on other sites More sharing options...
TB1 Posted March 1, 2014 Report Share Posted March 1, 2014 I'd be grateful if you could share with me your code for the metar pullout. Quote Link to comment Share on other sites More sharing options...
Kapitan Posted March 2, 2014 Report Share Posted March 2, 2014 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. Quote Link to comment Share on other sites More sharing options...
pilotconnor Posted April 12, 2015 Report Share Posted April 12, 2015 can i get one where i manually put the ICAO in a text box Quote Link to comment Share on other sites More sharing options...
alyousafi Posted May 21, 2016 Report Share Posted May 21, 2016 Hey can any one help me i want to display the metar in frontpage_main ?! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.