<div dir="ltr"><div dir="ltr"><div dir="ltr">Thanks for this, you are of course correct, and as always very helpful.<div><br></div><div>I regret to say the error was mine, and was simply due to case sensitivity, viz</div><div><span style="color:rgb(80,0,80)">$TotalCounterEnableG<b style="background-color:rgb(255,255,0)">EO</b>IP <> $</span><span style="color:rgb(80,0,80)">TotalCounterEnableG<b style="background-color:rgb(255,255,0)">eo</b>IP</span><span style="color:rgb(80,0,80)"> </span><br></div><div><span style="color:rgb(80,0,80)"><br></span></div><div><span style="color:rgb(80,0,80)">Simon</span></div><div><span style="color:rgb(80,0,80)"><br></span></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 15 Apr 2024 at 20:49, Petko Yotov <<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 15/04/2024 10:41, Simon wrote:<br>
> In a recipe I have a statement<br>
> \SDV($TotalCounterEnableGEOIP, 0); // default 0<br>
> <br>
> This sets the variable "$TotalCounterEnableGEOIP" or at least I assume<br>
> it does.<br>
> <br>
> Further on I use the variable in the statement<br>
> if ($TotalCounterEnableGeoIP == 1) {<br>
> <br>
> but PHP tells me<br>
> Undefined variable $TotalCounterEnableGeoIP in<br>
> D:\Home\KiwiWiki\pmwiki\cookbook\totalcounter.php on line 632<br>
<br>
Are both statements in the same scope?<br>
<br>
If the SDV() call is directly in the PHP file, and the conditional is in <br>
a function, you need to have a declaration in the function before you <br>
check the value:<br>
<br>
global $TotalCounterEnableGeoIP;<br>
<br>
If they are in different functions, you need to have the global <br>
declaration in both functions.<br>
<br>
Petko<br>
</blockquote></div>