__autoload($class) not working? class not found error

LattUsafe

New Member
I am following some examples in the \[code\]PRO PHP AND JQUERY\[/code\] book, but for some reason the examples doesn't work. Even the examples that I downloaded from the books site doesn't work. Not sure whats wrong, because I have done exactly as in the book.. /public/Index.php\[code\]include_once '../sys/core/init.inc.php';$cal = new Calendar($dbo, "2010-01-01 12:00:00"); //ERROR Class 'Calendar' not found\[/code\]/sys/core/init.inc.php\[code\] function __autoload($class) { $filename = "../sys/class/class." . $class . ".inc.php"; if ( file_exists($filename) ) { include_once $filename; } }\[/code\]/sys/class/class.calendar.inc.php\[code\]class Calendar extends DB_Connect{ private $_useDate; private $_m; private $_y; private $_daysInMonth; private $_startDay; /** * Create a database containg relevant info * * @param object $dbo a database object * @param string $useDate the date to build calender */ public function __construct($dbo=NULL, $useDate=NULL) { /* * Call the parent constructor to check db object */ parent::__construct($dbo); }}\[/code\]This is very annoying since every chapter in the books builds on this simple foundation. My guess is that \[code\]__autoload()\[/code\] is the problem, but I have no idea..
 
Top