Page 1 of 1

WU-forecast.php

Posted: Tue 16 Jun 2020 3:59 pm
by opleiwe
Is it possible to include the WU-forecast in a HTML document. I am redesigning my web site and would like to add forecasts, but I´m making the site in HTML. I can see in the PHP file there is a HTML section generating tables, I guess getting that part into my HTML document, will do the trick, but how?

Kenneth

Re: WU-forecast.php

Posted: Tue 16 Jun 2020 4:38 pm
by saratogaWX
You generally can't include a .php into a .html document as the PHP interpreter only will run on a .php page. However, if you rename your .html page to .php it will continue to display as before, and you can use an

Code: Select all

<?php include_once('...php''); ?>
to cause the included script to run.

Secondly, the old WU-forecast.php will run no more as WeatherUnderground turned off the API that script used.
There is a replacement script providing the same functionality called WC-forecast.php

Directions for getting it to work (and a download) are at https://saratoga-weather.org/scripts-WC ... WCforecast
Note that in order to get a new API key, you must have a weather station submitting data to weatherunderground.com

Hope this helps...
Best regards,
Ken