Page 19 of 19

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Tue 23 Feb 2021 4:55 pm
by tmabell
Okay it is still crashing. I'm attaching the current version with that edit so there is no confusion.
Select a Year or Month report

Fatal error: Uncaught TypeError: Unsupported operand types: string * int in C:\www\Noaa-Reports-New.php:277 Stack trace: #0 {main} thrown in C:\www\Noaa-Reports-New.php on line 277
Noaa-Reports-New.php.txt

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Tue 23 Feb 2021 10:05 pm
by beteljuice
Fatal error: Uncaught TypeError: Unsupported operand types: string * int
OK. PHP8 no longer supports my 'dirty ' string to numeric fix either.

This a very, very, bad news. the beteljuice has gazillions of code that uses it :(

... back to this plot ;)

Code: Select all

//change 
$first_year = $first_year *1;

//modified
$first_year = intval($first_year);

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Tue 23 Feb 2021 10:41 pm
by tmabell
Wowzers! :o That change induced a slew of warnings, the extent of which I cannot report due to the fact that we got caught in a loop of repeating the same warnings over and over. They wouldn't stop. I had to stop the server to keep the error log from growing exponentially. Here is what keeps repeating continually:
Select a Year or Month report

Warning: Undefined array key "0999" in C:\www\Noaa-Reports-New.php on line 517
Warning: Trying to access array offset on value of type null in C:\www\Noaa-Reports-New.php on line 517
Warning: Trying to access array offset on value of type null in C:\www\Noaa-Reports-New.php on line 517
Warning: Undefined array key "0999" in C:\www\Noaa-Reports-New.php on line 517
I'll keep at this but I would like to wait until I can use my off-line test machine, if that's alright with you. That will be first thing tomorrow morning as i am not at home now. (I run my own Apache server located there). And if it would work better we can work through pm's or email so as not to fill up this thread. Let me know your thoughts.

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Wed 24 Feb 2021 4:05 am
by beteljuice
Hmmph ....

the beteljuice uses:

for ($y = $now_year; $y >= $first_year; $y--) { // in two places

I have proven $now_year is a number (using !is_char(), because is_numeric() returns true if string looks like a number)
Edit: the beteljuice is a numpty - should have used is_string() - :evil:
We have ensured that $first_year is a number by using intval()

Yet at least one if not both of the loops is 'counting' down from "0999" to "0000" in PHP8 :bash:
The actual error messages are being produced by the second loop.

I need to think how to debug this one .....

Look for approx. your line 350

Code: Select all

	} // END year step through
 
 
 
// Now PREPARE the reports

// change to
	} // END year step through
 print_r($nav_build);
 exit;
 
// Now PREPARE the reports

This will show what the first loop has done, and the prog will quit before producing 36000 lines of errors :lol:

No rush ... PM me when you've done it please.

PHP8 Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 27 Feb 2021 2:34 pm
by beteljuice
Sorry about the delay ...

After a testing time with Tom (tmabell) a few edits to make the prog PHP8 compliant. ;)

No need to to update unless you have to, although it IS backwards compatible.

New zip in first post

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 27 Feb 2021 9:14 pm
by beteljuice
Brian - BCJKiw, reminded me of another tweak that we did for his version which tackles the degree symbol problem. :?

Added to the new(er) download ... ;)