I am trying to use a class that I wrote to use on another page (to use the functions and what not). In the class I have the constructor like this:

<?php
class myClass{
        function  __constructor(){
              //stuff here
        }
}
?>

And in my other file, where I am trying to use this class I have:

<?php
        $obj = new myClass();
?>

And it tells me that the class was not found.
I don't know what to do?
Any help would be great, thanks.

Recommended Answers

All 4 Replies

Did you remember to include the class with include() or require()?

no i did not do that. What's the difference between include and required?

The page will continue to run if an included files cannot be found. A page will end with a fatal error if a required file cannot be found.

Thanks for the information.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.