Single Page Variable Scope

Permalink
<?php
$productsInc="products_export.php";
function productsUrl($category){
    global $accountNumber, $accountPassword, $productsInc; 
    echo "file is " . $productsInc;
}
?>

When this page is run by itself it echos "file is prodcuts_export.php", But when it is run as a "Single_Page" within Concrete5, It echos "file is " and also has no errors.

The page loads. And the echo isn't hiding in the layout. The variable is just not passing correctly to the function. Why?

 
usedearplugs replied on at Permalink Reply
Any hope for getting help on this? The PHP works as standalone, but as soon as it's loaded in SINGLE_PAGE mode within the template it fails.... The template loads. The PHP runs, but the variable scope is screwed.
ThomasJ replied on at Permalink Reply
ThomasJ
This is a vary good question. Why doesn't global variables work in c5 controllers? I would like to ask the same question. Is there a reson that after 8 months, no one has an answer to this?