Re: ./ a small thing but it seems to do a lot

Discussion in 'HTML' started by Jeremy Williams, Jul 22, 2003.

  1. David Graham wrote:
    > Hi
    > I often come across ./ in links such as below
    >
    > <div class="buttons">
    > <a href="./index.php?screen=test">test</a>
    > <a href="./index.php?screen=longerTest">longerTest</a>
    > </div>
    >
    > Mousing over the top link reveals the full URL in the status bar,
    > like this
    >
    > http://porjes.haxorz.org/index.php?screen=test
    >
    > So the ./ notation takes you to the next page on the site via a full
    > URL.


    Not quite. The "." is an old DOS/UNIX/IBM phrase for "current folder".
    You'll know the ".." phrase meaning "parent folder". Try it in a DOS window,
    IIRC there is even "cd ..." which takes you back up two levels. Still useful
    for things like WinZip (when you want to extract into the current folder
    without browsing or typing 80 characters) or Office (saving files).

    >My site is hosted by phphosting.com. They store all sites like
    > mine in a folder called, naturally enough:
    >
    > www
    >
    > if I use a link on a page in my site to the home page like this
    >
    >
    > <a href="./>home</a>
    >
    > then I see in the status bar
    >
    > http://www.catalysys.co.uk/
    >
    > There is no www folder in the URL - why not?


    Because your site refers to that directory. It's a bit (though not much)
    like defining a drive letter in Windows. You can't get to the parent
    directories in Explorer (if you set the properties correctly). Since the www
    is redundant (being a parent directory), you don't see it.

    >
    > When I try the links that have ./ in them on my local computer,
    > rather than getting the home page as expected, I get the folder that
    > contains the site on my PC opening up showing the folder and file
    > icons the make up my site.


    Normal.

    > If I use a forward slash with no period
    > infront of it, would that go to the root folder and then find and
    > open the index page on my PC or on the internet ? (all pages on my
    > site, both locally and on the remote host are stored in the same
    > folder - as I pointed out earlier, this is called www on the remote
    > host)


    This is undefined. Conventionally "//" is the root of the local storage unit
    and "/" is a subdirectory referred to wherever the file pointer is at the
    time.


    >
    > thanks
    > David
     
    Jeremy Williams, Jul 22, 2003
    #1
    1. Advertising

  2. In article <bfjf2l$11c$>,
    says...
    > David Graham wrote:
    > > Hi
    > > I often come across ./ in links such as below
    > >
    > > <div class="buttons">
    > > <a href="./index.php?screen=test">test</a>
    > > <a href="./index.php?screen=longerTest">longerTest</a>
    > > </div>
    > >
    > > Mousing over the top link reveals the full URL in the status bar,
    > > like this
    > >
    > > http://porjes.haxorz.org/index.php?screen=test
    > >
    > > So the ./ notation takes you to the next page on the site via a full
    > > URL.

    >
    > Not quite. The "." is an old DOS/UNIX/IBM phrase for "current folder".
    > You'll know the ".." phrase meaning "parent folder". Try it in a DOS window,
    > IIRC there is even "cd ..." which takes you back up two levels.


    Depends on the OS. In Windows 98 there was
    cd ........
    which took you back loads of levels.
    --
    Hywel I do not each quiche
    http://hyweljenkins.co.uk/
    http://hyweljenkins.co.uk/mfaq.php
     
    Hywel Jenkins, Jul 22, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard
    Replies:
    4
    Views:
    419
    Art Sackett
    Jul 24, 2003
  2. Replies:
    12
    Views:
    527
    Andre Kostur
    Sep 28, 2005
  3. Stimp

    small thing on VS2005

    Stimp, Aug 10, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    310
    Alexey Smirnov
    Aug 10, 2007
  4. Replies:
    0
    Views:
    300
  5. Zam
    Replies:
    1
    Views:
    257
    Mark Schupp
    Mar 14, 2005
Loading...

Share This Page