General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 10th, 2003, 12:15 AM
Alicia Alicia is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 117 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 29 sec
Reputation Power: 6
use of relative links

Hi guys,

I am a little confuse of using relative links.. by given the following case

public_html->myfolder1->myfolder2->myfolder3->myfolder4

- if i have a file in myfolder2 and i want to include a file in myfolder1.. is it i use ./filename or ../fielname ??

- how about if i have a file in myfolder4 and i wanna include a file in myfolder3.. is it i need to use ../filename or do i need to include the folder name as well ?

- is it ../ means back to one folder ? if yes, how about ./ and when we are using relative links, do we need to include the folder name of the file as well ?

- if i have a file in myfolder3 and i wanna include a file in a sub folder of myfolder1 by assuming it is called myfolder1a, is it i need to use ../../myfolder1/filename or ../../myfolder1/myfolder1a/filename?

i am very confuse about using relative links when including a file. Hope you guys can give me an idea about this.

Thank you.

Reply With Quote
  #2  
Old November 10th, 2003, 07:52 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Dot-dot (..) means go up one directory. Dot (.) means the current directory. You can string dot-dots together to go up multiple directories. So to go from myfolder to to a file in myfolder1, you'd do ../filename. You'd do the same if you're in myfolder4 and you want to include a file from myfolder3. In both cases, the dot-dot means to go up one directory. If you're in myfolder3 and you want to include file myfolder1a from folder myfolder1, you'd use ../../myfolder1a/filename. You're going up two folders so that you're in myfolder1, and then descending into myfolder1a from there to include your file.

Reply With Quote
  #3  
Old November 10th, 2003, 09:53 PM
Alicia Alicia is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 117 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 29 sec
Reputation Power: 6
thanks for your info...

another thing i wanna ask.. one dot is for current directory right ??

is that mean if my current file is in folderA and i wanna include a file in a sub folder of folderA.. i need to do like ./images/finename ?

but right now, i just use image/filename and it works fine... is it optional for me either add ./ or nothing when i wanna include a file in the same folder ?

please advise.

Reply With Quote
  #4  
Old November 11th, 2003, 08:16 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Yes, the single dot is typically optional. It's used most often when you're running programs from the command line in *NIX.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > use of relative links


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT