__autoload is not executing in PHP

cajunboy2208

New Member
So I trying to autoload classes in PHP; however, the \[code\]__autoload()\[/code\] function does not seem to be executing. Even I try \[code\]echo\[/code\]ing the \[code\]$class_name\[/code\] variable, I don't see anything except the output I have provided below. I have included all of the relevant files and stripped out the irrelevant parts of it. According to a note in PHP: Autoloading Classes - Manual, I cannot use \[code\]__autoload()\[/code\] in CLI interactive mode, which I am not using. Any pointer will be much appreciated. Thanks.Output of index.php:Fatal error: Class 'Calendar' not found in /home1/tylercro/public_html/cb-test/index.php on line 3index.php:\[code\]<?php require_once($_SERVER['INCLUDES'] . 'prep.php'); $smarty -> assign('calendar', new Calendar());?>\[/code\]prep.php:\[code\]<?php error_reporting(-1); function __autoload($class_name) { include($_SERVER['CLASSES'] . $class_name . '.php'); } require_once($_SERVER['SMARTY_BIN'] . 'Smarty.class.php'); $smarty = new Smarty();?>\[/code\].htaccess:\[code\]Options -IndexesSetEnv CLASSES /home1/tylercro/public_html/cb-test/includes/classes/SetEnv INCLUDES /home1/tylercro/public_html/cb-test/includes/SetEnv SMARTY_BIN /home1/tylercro/smarty/\[/code\]
 
Top