have a file like so:
<?php
require_once "properties.php";
$GLOBALS["to_home"] = "../sfair";
echo tohome () . "index.php";
?>
And properties.php:
<?php
function tohome()
{
if(isset($GLOBALS['to_home']))
{
return $GLOBALS['to_home'] . "/";
}
else
{
return "';
}
}
Which should give me ../stair/index.php
.
But instead gives me index.php
.
How can I make the included file be able to access the variables of the including files?
note: I found another answer ("unable to access global variable from included file" but it did not work.