title: __autoload($class) not working? class not found error
body: <p>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.. </p>
  
  <p>/public/Index.php</p>
  
  <pre><code>include_once '../sys/core/init.inc.php';
  $cal = new Calendar($dbo, "2010-01-01 12:00:00"); //ERROR Class 'Calendar' not found
  </code></pre>
  
  <p>/sys/core/init.inc.php</p>
  
  <pre><code>    function __autoload($class)
      {
          $filename = "../sys/class/class." . $class . ".inc.php";
          if ( file_exists($filename) )
          {
              include_once $filename;
          }
      }
  </code></pre>
  
  <p>/sys/class/class.calendar.inc.php</p>
  
  <pre><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></pre>
  
  <p>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.. </p>