Imad Posted July 19, 2008 Share Posted July 19, 2008 Hi guys, I created a class in a file named classes.php I then included the file into another and tried to use the class like so: $files->index; I then get this error: Undefined variable: files Any ideas? Best Regards. Link to comment https://forums.phpfreaks.com/topic/115601-class-not-working/ Share on other sites More sharing options...
ignace Posted July 19, 2008 Share Posted July 19, 2008 you did not declare $files. solve by typing somewhere $files = new YourClass(); Link to comment https://forums.phpfreaks.com/topic/115601-class-not-working/#findComment-594267 Share on other sites More sharing options...
Imad Posted July 19, 2008 Author Share Posted July 19, 2008 Thanks, that worked. Link to comment https://forums.phpfreaks.com/topic/115601-class-not-working/#findComment-594271 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.