Try replacing in raintodate.php function get_mtd_rain ($start_year,$day,$month,$year,$loc)
{
$years = $year - $start_year;
$months = 0;
for ($i = 0 ; $i < $years ; $i++)
{
$filename = "dailynoaareport" . ( $month) . ($start_year + $i) . ".htm";
if (file_exists($loc . $filename) )
{
$data[0] = getnoaafile($loc . $filename);
$months = $months + 1;
// Now get data from the dailynoaareport for this month from the 1st to today's date'.
for ($d = 0 ; $d < $day ; $d++)
{
$rain = $data[0][$d][8];
if ($rain != "")
{
$month_rain = $month_rain + $rain;
}
}
}
}
with function get_mtd_rain ($start_year,$day,$month,$year,$loc)
{
$years = $year - $start_year;
$months = 0;
$month_rain = 0;
for ($i = 0 ; $i < $years ; $i++)
{
$filename = "dailynoaareport" . ( $month) . ($start_year + $i) . ".htm";
if (file_exists($loc . $filename) )
{
$data[0] = getnoaafile($loc . $filename);
$months = $months + 1;
// Now get data from the dailynoaareport for this month from the 1st to today's date'.
for ($d = 0 ; $d < $day ; $d++)
{
$rain = isset($data[0][$d][8])?$data[0][$d][8]:'';
if ($rain != "")
{
$month_rain = $month_rain + $rain;
}
}
}
}