PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Defkon1
Forum Newbie
Posts: 19 Joined: Thu Aug 09, 2007 9:13 am
Post
by Defkon1 » Fri Aug 17, 2007 4:54 am
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?
Last edited by
Defkon1 on Fri Aug 17, 2007 5:19 am, edited 2 times in total.
Defkon1
Forum Newbie
Posts: 19 Joined: Thu Aug 09, 2007 9:13 am
Post
by Defkon1 » Fri Aug 17, 2007 5:18 am
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Fri Aug 17, 2007 5:18 am
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.
Defkon1
Forum Newbie
Posts: 19 Joined: Thu Aug 09, 2007 9:13 am
Post
by Defkon1 » Fri Aug 17, 2007 5:21 am
thanks d11wtg... i was overconfident on that path...