Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 18th, 2001, 02:23 AM
NZ Joe NZ Joe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: Kapiti, New Zealand
Posts: 36 NZ Joe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
stupid link question

This may seam like a stupid question but here goes. What do the dots and slashes before hyperlinks do? ie: some code I read has ../link.htm some has ./link.htm and some just /link.htm. I know that one is for going back through the directories, but what are the others? Are they typos, alternatives or do they serve some other purpose?
__________________
Gravity always wins

Reply With Quote
  #2  
Old July 18th, 2001, 07:19 AM
tejdajatt tejdajatt is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: London
Posts: 3 tejdajatt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to tejdajatt
../link.htm is for going back through the directories
./link.htm stands for the current directory
/link.htm i'm assuming it means the root directory although i am not 100% sure about that one.

Hope that helps.

Reply With Quote
  #3  
Old July 27th, 2001, 07:44 PM
jakke jakke is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Belgium
Posts: 10 jakke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
almost right...
when dots are used, the link is 'relative' to the current document. When slashes are used (without dots), you use absolute links. Absolute links will try to search the exact location of the link, no mather where your page is situated.
recap:
index.html, ./index.html and ../index.html are relative paths, while HTTP:// links are absolute paths (any other absolute path will probably lead to error messages).

Reply With Quote
  #4  
Old July 27th, 2001, 11:16 PM
asterisk asterisk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Birmingham AL soon chicago
Posts: 2 asterisk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to asterisk
dots and slashes

../index.htm means go one directory up from this one and look for a file called index.htm

../../index.html go 2 directories up

../pages/index.html go up one directory and into the pages directory and look for a file called index.html

/pages/index.htm means start from the root directory and follow it down into pages and look for index.htm

./index.htm the dot means present directory. I havent seen it in urls because it's sort of redundent. you say the same thing by just writing index.htm

the leading dot in unix environments means to execute the file as in ./script.sh this would run a shell script in this directory ./scripts/help/script.sh would begin looking in the current directory for a directory called scripts and then one called help for a file called script.sh and execute it.

Reply With Quote
  #5  
Old July 27th, 2001, 11:22 PM
asterisk asterisk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Birmingham AL soon chicago
Posts: 2 asterisk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to asterisk
paths

also, http:// is almost always what you'd use to link to a page on another server. You don't have to use it if the link is to something local.

Reply With Quote
  #6  
Old July 27th, 2001, 11:46 PM
sLiPkNoT rUlEz sLiPkNoT rUlEz is offline
PHP Coder
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Ontario
Posts: 66 sLiPkNoT rUlEz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to sLiPkNoT rUlEz Send a message via AIM to sLiPkNoT rUlEz Send a message via Yahoo to sLiPkNoT rUlEz
Re: paths

Quote:
Originally posted by asterisk
also, http:// is almost always what you'd use to link to a page on another server. You don't have to use it if the link is to something local.


unless you're testing a server-parsed script of your own...
__________________
Click here and wait. It's a kewl effect, trust me.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > stupid link question


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 2 hosted by Hostway