Ok, I have a situation where I have several files in different directories and need to figure out how to link them all together. Here is the structure:
- /home/username/public_html/index.php
- /home/username/public_html/secure/index.php
- /home/username/public_html/elements/includes/db.php
- /home/username/config.ini
Ok, so in both of my index.php files i have this include referencing db.php:
index.php
<?php include("elements/includes/db.php"); ?>
and secure/index.php
<?php include("../elements/includes/db.php"); ?>
Now inside of the db.php file, I have the following reference to config.ini:
$config = parse_ini_file('../../../config.ini');
I know its not picking up because it should be relative to index.php instead of db.php, but how would I reference these files correctly? I want my config.ini to be outside of the public_html directory.