Results 1 to 7 of 7

Thread: Go Back

  1. #1
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default Go Back

    I remember there is a command for file paths in browsers to make it go back a directory then forward. But I can't remember what it is.

    Example:
    KEY:
    >> = Directory; If "--" before it, its a directory inside the directory above.
    > = Page; If "--" before it, its a page inside the directory above.



    >> Images
    > Page 1, Image Path: image/image1.gif - OK
    >> Programs
    --> Page 1, Image Path: (something like) \\image/image1.gif - UNKNOWN


    I hope I made it clear enough.

    Thanks,
    Tim

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'm not quite sure about your question, but here is an overview of how paths work:

    file.ext is a file existing in the current directory (same as the webpage)
    dir/file.ext is a file in the directory 'dir' within your current directory
    ./file.ext is the same as 'file.ext', since ./ means current directory
    /file.ext is the root, so yoursite.com/file.ext, no matter from where you link to it
    ../file.ext is in the folder above the current directory.

    I think you want the last one.
    For example if you have:
    mysite.com/content/pages/examples
    And you are in the examples directory,
    a link "../../index.htm" would be the index page of the 'content' directory.

    I hope this helps.

    Remember, any combination of these is possible, and it's all relative. Once a command is made, it starts from there.
    .././files/../../test
    Means: up one, same directory, into "files", up one, up one, into "test".
    Obviously that's more than you'd ever want to use, but it's worth seeing a visual.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    Thank you! Thats EXACTLY what I wanted.

  4. #4
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    depending on how "far back" what you are looking for is, it is also possible to start the the very beginning and then map your site from there....
    take for example I am at the url
    HTML Code:
    dividinglimits.com/code/html/templates/home.html
    and on that page I need to get an image that is in my "images" folder that is on
    HTML Code:
    dividinglimits.com/images
    there are a couple ways of doing that, you could use a relative path
    HTML Code:
    <img src="../../../top_bg.gif" alt="top background" />
    or i could use a path from "home"
    HTML Code:
    <img src="/images/top_bg.gif" alt="top background" />
    now those would both point to the same image at the same place on the server, but they are 2 entirely different methods of getting there.

    One is not necessarily better then the other, as they both have pro's n con's; they're just differnet ways, and which ya use it up to you

  5. #5
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    Hmm... Well, for now I'm gonna stick with the ".." method. My sites done (designed, has content, etc.) I just completely forgot how to do that.

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    And don't forget you can always just use an absolute URL if needed.
    ("http://......file.ext")
    The above URLs are called "relative".
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    I believe when you use absolute url's you have to reload them into your cache if they were loaded via relative previously, so if you use relative, stick with relative, and vice-versa.
    - Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •