I have my main index.php file and in there I include a top.php and a bottom.php file which are stored in an includes folder.
<?php require_once("includes/top.php"); ?>
<?php require_once("includes/bottom.php"); ?>
Now, I have added an admin folder which will store all the documents related to the sites cms, I built a page of the cms as index.php but within the admin folder and also used includes to add the top and bottom pages but included them as:
<?php require_once("../includes/top.php"); ?>
Basically just adding "../" to the file path so it can find the files.
In the top.php file I include a file named db.php also stored in the includes file like:
<?php require_once("includes/db.php"); ?>
Now, when I view my main cms page, the top and bottom files are includes fine but those files cannot find the db.php page as that icnlude link doesn;t have the "../" in front of the pathname.
How can I get the reference to work from both the CMS folder and the main website files.
I did expect it to work but it doesn't.
I would appreciate quick help with this if possible.