Page 1 of 1

[SOLVED] Fatal error: Class not found

Posted: Fri Aug 17, 2007 4:54 am
by Defkon1
i've included some classes in a script (as posted here), but when i try to instantiate an object from one of them i receive this error...

Code: Select all

include ('./class/algoritmogenetico.php');

$obj = new AlgoritmoGenetico();
:( what's wrong?

Posted: Fri Aug 17, 2007 5:18 am
by Defkon1
sorry, i'm an idiot.

a bad path in the include function... i've used a require instead of a include to find the error.

:oops: :oops: :oops: :oops: :oops:



please close this topic and bury me under six feet of asp code lines... :oops:

Posted: Fri Aug 17, 2007 5:18 am
by Chris Corbyn
Change your "include" to "require" and post any changes to the error message please ;)

Always use "require" for class files since require causes fatal errors if the file isn't there, whereas include doesn't.

Posted: Fri Aug 17, 2007 5:21 am
by Defkon1
thanks d11wtg... i was overconfident on that path... :oops: