I have two really trivial sounding problems with paths. I am constructing a site on my Windows box with Minixampp (i.e. Apache) which I then move to my ISP (Unix with Apache). On some pages I'd like to use paths that are relative to my html root directory, e.g /Navigation/TreeMenu.php.
I have Images directory for images and TreeMenu directory for navigation menus.
I'm using the following looking code in practically all pages to set up the navigation, background, banner etc.
Code: Select all
<script src="/Navigation/TreeMenu.js" language="JavaScript" type="text/javascript"> </script>
<link href="/Navigation/TreeMenuMyStyle.css" rel="stylesheet" type="text/css">
<body background="/Images/GrayBackground.jpg">
<img border="0" src="/Images/MyBanner.jpg" width="790" height="92">
<?php require_once( '/Navigation/TreeMenuMySite.php' ); ?>2) On the Unix this doesn't work at all. I know the reason for it is that on my machine $_SERVER['DOCUMENT_ROOT'] gives e:\minixampp\htdocs which is the root of my web pages, whereas on the Unix it gives something like /opt/apache/htdocs which isn't my personal html root. How should I set the paths so that filenames e.g. /Images/MyBanner.jpg would work both on my local machine and on the ISP??
Thanks for any assistance!
- Marko
P.S Cheers to the TreeMenu(XL) authors!