Hello All

I am currently reworking a past project and am getting rid of most of the procedural code and replacing it with classes. everything is going quite well but the paths are driving me nuts. I am trying to use one consistent solution for all links and include files but every variation I try seems to have an issue somewhere. I will run down what I have tried and see what your suggestions are.

1) page relative:
Code:
include('../classes/myClass.php');
this doesn't work when I am more than 1 folder deep. I have a loader class that does not currently account for how many folders deep the call is benig made from.

2)
root relative i.e.
Code:
include('/myproject/classes/myClass.php');
This includes properly from where ever it is called, but then I have a problem with instantiating.
Code:
include('/myproject/classes/myClass.php');
myClass = new myClass;
This gives me an error saying that the myClass class cannot be found. I have looked around but have no clue why this is happening.

3) absolute paths
Code:
include('c:/wamp/www/myProject/classes/myClass.php');
the includes work fine but my sessions went haywire when I went to this method. My login page does not work anymore and I beleive it is because it is setting 2 different session id's - one for the login page and another when it redirects to the rest of the site.

Does that make sense?

Thanks

Matt