Hi All
I have a project working in PHP which is divided in an admin section and client section.
Client ecd is working perfectly fine. But I Cannot access my admin section and it displays the error saying
Fatal error: Class ‘ClsBase’ not found in E:\wamp\www\dfms\admin\index.php on line 30
UPDATE
line 28 is $base_obj = new ClsBase();
UPDATE1
LINE 14:include_once(ADMIN_CLASS_DIR .”ClsAdminUser.php”);
But I have defined all the constants in my adminconfig.php And I am using the Constant to give the path to this file and also this file present in the required folder
Could you please help me What could be the problem?
Without seeing code, it’s hard to tell. There are two possible problems.
ADMIN_CLASS_DIRis not set, so PHP will issue anoticeand default toADMIN_CLASS_DIR. Your code would look like:To fix it, just define the directory:
You’re trying to use it inside of a string literal:
Constants in PHP don’t work like that. They are only resolved outside of a string. So you could do either:
Or you could do this if you needed to define the constant as a string:
To tell if the constant is defined, use the
definedfunction. It’ll returntrueif the constant is defined.If you want better help than that, post some code!