There must be something i don\'t understand about linking files -- but here\'s my problem.
Basically, i have three files.
When you use include to include a file, and you use a relative path as parameter, it will be relative to the current working path.
What is the current path? It is normally the path of the first called PHP script. The script where the whole execution started. You can get the current working dir with the function getcwd. For example: will show you the current working path. You can change the current working path using the chdir function. For example: - with this command you just changed the current working path!
So, it is not always good to use relative paths in include, because the current path MAY change.
But with the usage of the __FILE__ magic constant you can use a sort of relative path as a parameter for an include, making it relative to the file where the include command is. This is good! Because no matter what the current working path is, the include will be always relative to the file which is including!
So... try the following:
In B you should include A as follows:
include( dirname( __FILE__ ) . '/../../../phpfunctions/generalfunctions.php' );
In C you should include B as follows:
include( dirname( __FILE__ ) . '/../wordcount.php' );
In short: using dirname( __FILE__ ) you can include the file using a path relative to the file where the "include" command is. Otherwise, the path will be relative to the current working path.