3 in 1 php error

Hi
This morning I have started getting a php error on my 3in1 script. If you could please look at my home page - www.derbyweather.co.uk - you can see the error overlaid in the top banner.
Can anybody please suggest any fix for this? I think the program is so old now it is no longer supported.
Any help would be gratefully appreciated
Regards
Dave

Those “messages” show as the provider defaulted php to “show all messages”, be it notices, warnings, error or fatal messages.
This is a warning as the php script writers often not used quotes around constants.

Warning: Use of undefined constant lang - assumed 'lang' (this will throw an Error in a future version of PHP) in /home/r11derby/public_html/wxsim_wxalltopen/sivu3.php on line 12
These messages are there so that the script writer can change the code to comply with [b]future[/b] releases.

In the past most providers blocked all messages and for testing we had to switch it to on.
Now we have to switch it off.

Maybe in your cPanel there is a setting for the php.ini ?

Or you can modify the first line in wxsim_wxalltopen/sivu3.php were it says <?php
Depending on the version, somewhere around line 7 although the error points to line 11-12

<?php
if(isset($_GET[lang])) {$lang = $_GET[lang]; }

Change that to

<?php ini_set('display_errors', 0);   error_reporting(0);
if(isset($_GET[lang])) {$lang = $_GET[lang]; }

Succes, Wim

Wim - that’s perfect.
Very many thanks for your time
Kin regards
Dave

Wim,

I have a question for you, i began searching on the “stackoverflow”-forum and i changed the code to what they suggest there, putting the single quotes between the square brackets, this solves the error but does this break the script? I have done this with multiple scripts because i am running on PHP8 now because my provider (one.com) has recently upgraded to that version and i can’t go back because it’s mandatory…

Thank you for your answers!

Marc from WXEkeren,

No, if correctly done it can not break the scripts.
The " or ’ were optional but PHP is far more strict nowadays.

Wim