title: __autoload() doesn't work in included files
body: <p>I have a index.php file where the function __autoload() is on top.</p>
  
  <p>The function looks like this (I'm using smarty):</p>
  
  <pre><code>function __autoload($classname) {
  
      echo "Loading classname.\n";
  
      if (substr($classname, 0, 15) == "Smarty_Internal") {
          $classname = "./libs/sysplugins/" . strtolower($classname);
          require_once $classname . ".php";
      }
      else {
          include $classpath.$classname.'.php';
      }
  }
  </code></pre>
  
  <p>This works fine in this file.</p>
  
  <p>Further down I have included another file with </p>
  
  <pre><code>include './files/otherfile.php';
  </code></pre>
  
  <p>In this file, I'm trying to load a class with</p>
  
  <pre><code>$bla = new ClassName;
  </code></pre>
  
  <p>But whenever i load the page i get this message:</p>
  
  <pre><code>Fatal error: Class 'ClassName' not found in ...
  </code></pre>
  
  <p>It doesn't even try to load the class with autoload, I don't get a "Loading classname." message which should be there.</p>
  
  <p>Does anyone know why this doesn't work?</p>