2 problems with paths.
Posted: Thu Apr 15, 2004 5:07 pm
Hi,
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.
1) This works halfway on the windows box. It will load the images but the PHP require will fail. Why such different behaviour regarding the path in PHP? The HTML portion did find and load the .js and .css with similar path specifications!
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!
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!