V2.00 01-Jun-2009 BETA .005 - added proper fail message for when an invalid advisory zone is selected.
update - protect zone value input. allowed zone = [2letters][Z][3numbers]
this is critical because the zone input determines part of the cache file names that are written on the server.
file cache improvement - cache files are never written to the server unless there is a valid zone selected or set in settings. Before it would make an empty cache file anyway.
added a code fix suggested by curly: Sometimes the word " issued" isn’t included in the entry title so it won’t explode properly to “Tornado Watch”.
added more fixes for handling invalid zones - now checks both input and default zone configuration for both syntax and actual existence of the NOAA zone. If a bogus zone is offered, it does not write any cache files and then displays “Advisory Information Unavailable, invalid advisory zone selected.”
I’m using $_REQUEST[‘summary’] = ‘Y’; on a test page (http://www.harpersferry-weather.com/wxadvisory-2009.php). There are no watches, warnings, and advisories. What is returned is a link “Source: NWS Watches, Warnings or Advisories for zone WVZ053” only. I was expecting it should return something like "There are no active watches, warnings or advisories for zone WVZ053. "
<?php
$_REQUEST['zone'] = 'WVZ053';
$_REQUEST['inc'] = 'Y';
$_REQUEST['summary'] = 'Y';
$_REQUEST['noprint'] = 1;
include 'rrs-advisory-2009.php';
if (preg_match("|There are no active|i",$advisory_html) ||
preg_match("|Advisory Information Unavailable|i",$advisory_html)) {
echo '