referring back OUT of a directory

liunx

Guest
On my host server, I would like to set up a new section of a website I manage and am going to make a new directory for the page and graphic files in this section as it's going to get complicated. <br />
<br />
I use CSS on this site. Would it be easiest to just put another copy of the css file inside this directory, or can I refer OUT of the sub-directory to the general httpdoc? I also use an external javascript menu. Same question for the menu.js file, too...?? <br />
<br />
I know for regular html page files you can just link to the full URL but how can I refer to a CSS file or a javascript file or SSI outside of the directory I'm in... I hope this question makes sense. I did a search of the forums but could not find an answer to this. Sorry if I'm repeating and thanks for any help.<!--content-->Try using ./ just before the name of the file you're wanting to get.<br />
<br />
./filename.ext<br />
<br />
<br />
Examples...<br />
<br />
<?php include("./folder/filename.ext"); ?><br />
<a href=http://www.htmlforums.com/archive/index.php/"./folder/filename.ext">link</a><br />
<br />
See if that helps.<!--content-->why couldn't you use the full url?<!--content-->I like to refer to files by the full path relative to the root folder. That is, I use the absolute path:<br />
<br />
/folder/subfolder/filename.ext<br />
<br />
The leading slash IS important.<!--content-->Originally posted by MD Hall <br />
Try using ./ just before the name of the file you're wanting to get.<br />
<br />
To go up one directory it is: ../ not ./<br />
<br />
To go up two directories: ../../<br />
<br />
.....Willy<!--content-->To go up one directory it is: ../ not ./<br />
<br />
To go up two directories: ../../<br />
<br />
<br />
Sorry...I knew that...dont know what I was thinking<!--content-->./ also starts at the root.<!--content-->>> ./ also starts at the root. <<<br />
<br />
<br />
Umm, no, the root is when the path starts with a / with NO dots before it.<!--content-->that is not what I have experienced.<!--content-->hasnt this already been asked like 1242 cubed times?<br />
<br />
i think we should create a link, when visitors first sign up, to a tutorial on how to use the search button, no?<!--content-->Originally posted by Aboveaverage <br />
I did a search of the forums but could not find an answer to this. Sorry if I'm repeating and thanks for any help. <br />
<br />
Gregory, I DID a search. I tried several strings and came up with zilch.<!--content-->./ refers to the current directory.<br />
<br />
../ refers to the parent<br />
<br />
<br />
the problem with using absolute paths is that it is not very portable.<br />
<br />
<br />
/folder/subfolder/filename.ext<br />
<br />
is not an absolute path.<br />
<br />
you need to define a base - a drive letter or a domain name (which actually substitutes/maps for a physical drive location anyway).<!--content-->close Horus, and yes Giz, you were right, I had it backwards.<br />
<br />
./ refers to the current directory.<br />
<br />
/ refers to the parent (root)<br />
<br />
../ Goes back one level (directory)<br />
<br />
just tested<!--content-->
 
Back
Top