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. Quote 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(); Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/115601-class-not-working/#findComment-594271 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.