php includes
Posted: Tue Oct 12, 2004 7:52 am
I'm having some trouble with include, and I'm not sure if there's a way around it.
Here's a simplified version of my directories and files:
test.php
actions/login.php
classes/config.php
classes/database.php
My config.php includes database.php.
When I try to have test.php include config.php, config.php can't find database.php because it's looking in the directory that test.php is in, not it's current directory.
Is there some way around this? I realize that I can just have test.php do the database.php include before I include config.php, but I was hoping to avoid doing that.
Thanks for any suggestions,
Jesse
Here's a simplified version of my directories and files:
test.php
actions/login.php
classes/config.php
classes/database.php
My config.php includes database.php.
When I try to have test.php include config.php, config.php can't find database.php because it's looking in the directory that test.php is in, not it's current directory.
Is there some way around this? I realize that I can just have test.php do the database.php include before I include config.php, but I was hoping to avoid doing that.
Thanks for any suggestions,
Jesse