Re: About PHPWeather
Brought to you by:
iridium
From: Martin G. <mg...@da...> - 2005-03-04 15:05:22
|
hans leutscher <ha...@mo...> writes: Hi Hans > I'm sorry to disturb you, but I have just one simple question. > > Which file must I run to get the data? > > When I run phpweather.php in my browser, nothing happens, all I get is > an empty page. Yes, this file only declares the phpweather class. Try including the file in some other file and call decode_metar(). A complete test example: <?php header('Content-Type: text/plain'); // Plain text for a simple test. require('phpweather.php'); $weather =3D new phpweather(); print_r($weather->decode_metar()); ?> Put the above in a file and upload it to your server in the phpweather folder. That shows you all the data (in a somewhat raw form) obtained from the METAR report. To get a nicely formatted weather report you have to combine the $weather object with a output object, like this: <?php $output_text =3D new pw_text_nl($weather); $output_text->print_pretty(); ?> > I have spend quite some hours in the discussiongroups, but these > files are huge, and I cannot find the answer, therefore I write to > you. And I'm answering back to the list too, so that others might find the answer some other time. I fully agree with you that reading the index.php file supplied with PHP Weather is far from straight forward... > The testpage works at: http://www.atelier.box.nl/Hedane/pweather/ So far so good... > What do I not understand? > > (I have also tried the PHP weather script from Matt Wilson, which I > understand and it works. But I thought your script was better, > therefore) > > > > I hope you can help me out > > Thanks a lot > > best regards > > Hans Leutscher =2D-=20 Martin Geisler My GnuPG Key: 0x7E45DD38 PHP EXIF Library | PHP Weather | PhpShell http://pel.sf.net/ | http://phpweather.net/ | http://gimpster.com/ Read/write EXIF data | Show current weather | A shell in a browser |