__autoload函数没有在目录中加载类

I recently started learning object oriented programming so a lot of the stuff I am learning right now it relatively new to me. Anyway I am trying to load all of the classes in my classes folder '/classes/' but when the code is run I get an error when trying to access one of the files.

function __autoload($className)
{
    if(file_exists(DIR_FS_CLASSES . "class." . $className . ".php"))
        include DIR_FS_CLASSES . "class." . $className . ".php";
}

I have DIR_FS_CLASSES defined as 'classes/'

Why don't give this a try and see if this works.

function my_autoloader($class){
    require_once ($_SERVER['DOCUMENT_ROOT']."/classes/".'class.' . $class . '.php' );
}
spl_autoload_register('my_autoloader');

It could possibly be that the path is incorrect.