Hello,
I apologize if this is a repeated question, but I did not see it while I was checking the first few pages. Here is my dilemma.
I am trying to make a script using classes, and I'm having trouble getting the class to work. Here is my situation
index.php is the main page, which includes a header (header.php) and then pulls data from my MYSQL database and displays it.
header.php displays the header and links associated with index.php. header.php also includes a config.php while contains a class in it. This class loads some default variables in a constructor like so and echos them:
<? class foo
{
var $fooA;
var $fooB;
var $fooC;
function __construct()
{
$this->fooA="This";
$this->fooB="is";
$this->fooC="Broken";
echo fooA ." ". fooB." ". fooC." <br />\n";
}
}
?>
For some reason index.php loads header.php, but header.php does not load config.php....therefore nothing gets echoed. Is this a limitation of php or something wrong with my coding?