Cannot access variables added to Global Code

Hello,I am trying to add a few variables which I want to access from elsewhere as needed.For this I am using this code in Server Event → Global → All Pages → Global Code$igst = 0;
$cgst = 0;
$sgst = 0;Now I want to access these variables from Server Event → Table Specific → Add/Copy Page → Page_Load and assign them values based on which page is loadedAfter this I need to access these variables from Server Event → Table Specific → Add/Copy Page → Page_Render to echo a few strings based on the values of these variables.But I am getting error Undefined variable: sgst in C:\xampp\htdocs\lucky\cash_bookingadd.php on line 2357What mistake am I making here please guide me.TIAYogi Yang

Did you use global in the event?
For example:

// Page_Load Event
global $igst, $cgst, $sgst;…your code here…

Oh! how stupid of me.Thanks a lot.Now I see my mistake.I thought that by default all variables declared at Global lever are automatically visible through out the whole web application and I can access them without any special requirements.Once again thanks a lot.Regards,Yogi Yang

Quote from manual: "Global Code - Code to be included in all PHP pages. This may contain your constants, variables, functions and classes."Yet, when you add code to the Global Code section, it doesn’t get included anywhere.
Calling the var using
global $varname;
also didn’t workThankfully i found that phpmaker already had a variable defined for what I needed. However i’d really like some clear instruction on how this is supposed to work.For example, if I create a variable in Global Code, what do I need to do to be able to use that variable in Page_DataRendering?@digitalphotoworld the word “global” implies that its something that is appiled site-wide, yet your example is calling it at a Table-Specific level.
I needed to be able to call it on every page on the site automatically without having to edit Table-Specific scripts.

Even you set a global variable in Global Code, PHP still requires the global keyword or $GLOBALS when using them, read: https://www.php.net/manual/en/language.variables.scope.php. (digitalphotoworld’s answer was correct.)