tkyoung75 Posted March 11, 2014 Share Posted March 11, 2014 Hi, I am designing a new web page with a navigation bar (nav.php) that is used by pages throughout the site. The "nav" is in the main directory, some other pages are in the sub-directories. The (relative) links in "nav" do not work when referenced from a "file" in a subdirectory. I suspect this is because they are being read relative from the "file" directory, rather than the directory that "nav" is in. Please confirm that this would be the case!?! Please advise is this a suitable practice of using a single "nav" across all subdirectories (I was planning on nesting to a second level so that when the about button for instance is clicked it would show something like: HOME ABOUT SHOP [level 1] RED BLUE YELLOW BLACK [level 2 about red ones] so that a second nav bar in the about folder nested under the main "nav") or is it typical to just put a different one in each directory so they all have to be updated, or do I just put all the files in one directory or is there some other way that this might better be done? I've nearly got this working [file attached]: <?php $path = $server['DOCUMENT_ROOT']; $path .= "/subpath/public"?> <html> <a href=<?php print "$path";?>/pathext/about1.php>ABOUT1</a></html> When I view the source on my browser it is right, I can even cut and paste the path/file back into the browser and it works, but it doesn't work in the code. What am I am doing wrong here? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.