Tuesday, 17 September 2013

PHP website directory structure

PHP website directory structure

I am developing a PHP website. But I am confused about the directory
structure. My home directory structure is like this:
-index.php
-header.php
-footer.php
-product.php
-Folder1/index.php
-Folder2/InnerFolder/index.php
I have included header and footer in every page. Now I want the same
header.php and footer.php to be called by all index.php pages. But it
shows the other pages missing which are included from header. (e.g. CSS )
For Folder1 : I achieved it by changing my navigation links in header with
"../" But How would I do this for Folder2/InnerFolder ?
In short what is the ideal( and perfect) way to organize the pages which
won't disturb the future addition of new internal folders and their
index.php pages.
Please reply for your best practises.
Thanks

No comments:

Post a Comment