Home › Forums › Back End › php variable problems › Re: php variable problems
January 10, 2011 at 9:09 am
#66746
gno
Member
@marcdefiant: Take a look at this example:
require 'header.php';
$variableForHeader = 'HeaderInfo';
echo $variableSetInHeader;
require 'footer.php';
?>
The $variableForHeader will not be available in header.php for obvious reasons; it is declared after the header.php file is included.
The echo $variableSetInHeader will work as expected.
It is hard to say anything about what the error could be, when we have no clue about what your code looks like. ;-)