PHP - __autoload()
I'm trying to use the autoload class but am having some trouble. Here is my autoload class,
Code: [Select] function __autoload($class_name) { include("classes/" . $class_name . ".class.php"); } The problem I am having is that when I include this class at the top of this page I then keep getting this error - "Warning: Cannot modify header information - headers already sent by" whenever I try to start a session or use the "header" function but I'm not sure why that's happening because surely I haven't echoed anything yet. Thanks for any help. Similar TutorialsHi,
I've just found that __autoload function is no longer the thing to use when creating an object from your class. Well thanks a lot!!! Now we have this spl_autoload_register AND spl_autoload. All the manuals I've read I am still lost... just a simple example would be great!!!
|