Author Topic: Undefined variable $month_rain  (Read 485 times)

0 Members and 1 Guest are viewing this topic.

Offline ed2kayak

  • Ed
  • Forecaster
  • *****
  • Posts: 613
  • Davis Vantage Pro2 w/12 hr FARS, solar/uv
    • Cumberland Valley Weather
Undefined variable $month_rain
« on: February 14, 2022, 10:24:56 PM »
I've been updating site and associated scripts to move to PHP 8.1

I'm uncertain how to correct Undefined variable $month_rain warning.

http://cvweather.org/

Ed
CoCoRaHS PA-CD-6,  Weather Underground KPAMECHA7, CWOP DW5425

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Undefined variable $month_rain
« Reply #1 on: February 15, 2022, 03:50:59 AM »
You need to initialize the variable, after line 111 insert:
Code: [Select]
$month_rain = 0;
There are also e few errors in an aqi script near line 61/62 ( don't remember exact script name, it showed only the first time I loaded your page )

Offline ed2kayak

  • Ed
  • Forecaster
  • *****
  • Posts: 613
  • Davis Vantage Pro2 w/12 hr FARS, solar/uv
    • Cumberland Valley Weather
Re: Undefined variable $month_rain
« Reply #2 on: February 15, 2022, 10:56:59 AM »
Thank you, that fixed it.

I'll try to track down the other errors (aqi and cloud level).

That gets me on PHP 8.1
Ed
Ed
CoCoRaHS PA-CD-6,  Weather Underground KPAMECHA7, CWOP DW5425

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Undefined variable $month_rain
« Reply #3 on: February 15, 2022, 12:25:38 PM »
The cloud-base.php one is fixed in the alt-ajax-dashboard script set 6.95e at https://saratoga-weather.org/scripts-legacy.php#scott
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ed2kayak

  • Ed
  • Forecaster
  • *****
  • Posts: 613
  • Davis Vantage Pro2 w/12 hr FARS, solar/uv
    • Cumberland Valley Weather
Re: Undefined variable $month_rain
« Reply #4 on: February 15, 2022, 02:36:08 PM »
Thanks Ken, I noticed after I posted that the updated file was included in the legacy scripts package.

Thanks for keeping them up to date!




Sent from my Pixel 4 XL using Tapatalk

Ed
CoCoRaHS PA-CD-6,  Weather Underground KPAMECHA7, CWOP DW5425

 

anything