How the heck can I access session variables within a function? I regsiter a variable "var1" with $_SESSION[var1].
This variable I can access within another php-file which starts like
But when I call a function, the variable is not accessible:
Why?
This variable I can access within another php-file which starts like
Code:
<?
session_start();
echo($var1);
...
?>
But when I call a function, the variable is not accessible:
Code:
<?
test();
function test() {
echo($var1);
}
?>
Why?