Hello everybody,
Well, what I am trying to do is below:
I have three directories:
- includes(dir)
- scripts(dir)
- realstuff(dir)
I have a class file and a details.inc.php file inside includes
- includes
- connection_class.php
- details_class.php
The connection_class.php file uses the details_class.php to get the login details so in the connection_class.php file details_class.php will be an include file on top with line include_once("./details.inc.php");
If I create a new file called test.php in the same folder as the two files and include connection_class.php in the first line include_once(“connection_class.php”); it works…
Now If I go to the scripts folder and create another file test2.php and include the file include_once("…/includes/connection_class.php"); it fails as connection_class.php itself is looking for “./details.inc.php” file in the folder where it resides…
How can this issue be solved…I face the same problems when making templates and creating sub folders inside the main directory. The path to the images is lost…when the top_inc.php file is called from whithin anothe directory.
I hope you guys understood what I am trying to say…
Thanks!
da_linuxguru