|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
menu include - hyperlink problems
hey,
I have a structure like the following ROOT > index.php > menu.php > header.php > content.php FOLDER1 > content.php > another.php > index.php so there are many folders at root, that all have an index file. When I call say index.php in root, the links to other parts of the site would be like <a href="folder1/index.php">Folder 1 index</a> but when that index file in folder1 is opened, it includes the menu and header file from root... so the index in folder1 has include ('../menu.php') etc but obviously, the links in menu still refer to original paths.... so if I wanted to go back to the home page, it should be "../index.php" but it is still "index.php" Basically, I think I need a way to dertmine if the menu is being called in the root dir, then display a certain path, or if the menu is a folder away from root, to display other paths.. has anyone come across this problem, I'm sure you must have!! thanks!! |
|
#2
|
||||
|
||||
|
You might investigate splitting the URL on slashes and counting your elements to determine where in the tree you are. So:
PHP Code:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > menu include - hyperlink problems |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|