including or requiring a file does not change the working directory, so if you have this structure:

index.php
A/ClassA.class.php
B/ClassB.class.php

and index.php includes A/ClassA.class.php, from ClassA.class.php you need to use
include('B/ClassB.class.php');


Donahue Ben wrote:

I have a ClassA file and a ClassB file stored in
separate directories.  I am trying to get ClassB to
initiate a ClassA object.  But since they are stored
in seperate directories I get an error.

So I tried including the ClassA file in ClassB
constructor:

function ClassB()
{
 include("../A/ClassA.class.php");
 ...
}

i cant get this working. How do i solve this problem
without having both class files in the same directory.

Ben

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to