Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End php variable problems Re: php variable problems

#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. ;-)