jkewlo Posted September 12, 2009 Share Posted September 12, 2009 Ok here is another problem I am trying to pass the user login to check.php but I keep getting Fatal error: Class 'checkUser' not found in /var/www/www.eve-lounge.com/htdocs/v2/check.php on line 6 the class checkUser() exist within the function.class.php Its driving me nuts any help would be wonderful. which has <?php session_start(); require_once('data/function.class.php'); // Next, create an instance of the class $newCheck = new checkUser; // Call the registerUser() method, passing in the required variables $newCheck->checkUser($username, $password); ?> Quote Link to comment https://forums.phpfreaks.com/topic/174007-class-not-found/ Share on other sites More sharing options...
wildteen88 Posted September 12, 2009 Share Posted September 12, 2009 You sure you spelt your class name correctly? Post the code in function.class.php Quote Link to comment https://forums.phpfreaks.com/topic/174007-class-not-found/#findComment-917261 Share on other sites More sharing options...
PFMaBiSmAd Posted September 12, 2009 Share Posted September 12, 2009 You would need to post data/function.class.php for anyone here to be able to tell you why the class cannot be found. My guesses would be either: short open tags, a spelling error, more than one function.class.php at different paths and the one being used is not the one with the class definition in it. Quote Link to comment https://forums.phpfreaks.com/topic/174007-class-not-found/#findComment-917262 Share on other sites More sharing options...
gizmola Posted September 12, 2009 Share Posted September 12, 2009 The best practice is to keep classes in their own php file, named with the same name as the class. This also facilitates simple autoloading, if that idea appeals to you, and for the price of a bit of overhead, you won't have to worry about manually requiring class files. Quote Link to comment https://forums.phpfreaks.com/topic/174007-class-not-found/#findComment-917265 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.