Including menu.php in a pages in some other sub directories
Posted: Tue Mar 19, 2013 1:17 pm
I am learning PHP. I want to create a menu that can open pages from any folders in the site's directory irrespective of whether it is in a ./sub/sub/sub/directory. The following is the structure of the directories and files:
ROOT DIRECTORY
dirINCLUDES
header . php
footer . php
navigation . php
dirPROJECT
index . php
project1 . php
project2 . php
index . php(ie, homepage)
The following is in my navigation.php:
<ul >
<li><a href = "index.php" > home </a></li>
<li><a href = "project/index.php" > project </a></li> </ul>
Right now when I click on the "project" link, it takes me to the project/index.php, but when I am on that page and click on the"home" link it doesn't take me to the home page rather, it giving me the current path of that subdirectory which am in. I want to change the paths name to what it suppose to be.
Any help will be much appreciated. Thank you.
ROOT DIRECTORY
dirINCLUDES
header . php
footer . php
navigation . php
dirPROJECT
index . php
project1 . php
project2 . php
index . php(ie, homepage)
The following is in my navigation.php:
<ul >
<li><a href = "index.php" > home </a></li>
<li><a href = "project/index.php" > project </a></li> </ul>
Right now when I click on the "project" link, it takes me to the project/index.php, but when I am on that page and click on the"home" link it doesn't take me to the home page rather, it giving me the current path of that subdirectory which am in. I want to change the paths name to what it suppose to be.
Any help will be much appreciated. Thank you.