Jon Posted December 2, 2010 Report 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
Kairon Posted December 3, 2010 Report 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
Jon Posted December 3, 2010 Author Report 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
druptown Posted January 5, 2012 Report 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
freshJet Posted January 5, 2012 Report 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
druptown Posted January 5, 2012 Report 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
freshJet Posted January 5, 2012 Report 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
bteixeira Posted February 18, 2014 Report 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
freshJet Posted February 18, 2014 Report 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
bteixeira Posted February 24, 2014 Report 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
freshJet Posted February 25, 2014 Report Posted February 25, 2014 Yes. You won't see it on my site however, you can't see my briefings. Quote
Kapitan Posted February 28, 2014 Report Posted February 28, 2014 Have a look my metar http://enterairva.pl/ main page on right side Quote
TB1 Posted March 1, 2014 Report Posted March 1, 2014 I'd be grateful if you could share with me your code for the metar pullout. Quote
Kapitan Posted March 2, 2014 Report 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
pilotconnor Posted April 12, 2015 Report Posted April 12, 2015 can i get one where i manually put the ICAO in a text box Quote
alyousafi Posted May 21, 2016 Report Posted May 21, 2016 Hey can any one help me i want to display the metar in frontpage_main ?! Quote
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.