Results 1 to 8 of 8
  1. #1
    marlonolram
    Guest
    Re: Displaying graphics
    OK, I have developed a website on a PC but I have no access to a MAC to check the site out. Apparently, there are many graphics that are not being displyed for some reason (I am pretty much convinced it is something really simple like an incorrect path or something) but without access to a MAC, I can't check out what the problem is!!

    The URL is www.theflood.com.au - the source code is available to take a look at - any one have any ideas please???

    Thanks

  2. #2
    Re: Displaying graphics
    muso's Avatar
    Member Since
    Jan 15, 2003
    Location
    Whangarei, New Zealand
    Posts
    2
    Specs:
    Pwnt
    Some of your image tags are written with a path like this: \images\shimTrans01.gif

    It should be images/shimTrans01.gif - macs, and unix based hosts use paths with foward slashes and no slash at the start. Windows looks as though it supports both, so that's where your problem is.
    I'm in your forums, writing sentences in a grammatically acceptable manner.

  3. #3
    Re: Displaying graphics
    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    Quote Originally Posted by muso
    Some of your image tags are written with a path like this: \images\shimTrans01.gif

    It should be images/shimTrans01.gif - macs, and unix based hosts use paths with foward slashes and no slash at the start. Windows looks as though it supports both, so that's where your problem is.
    Wait a minute.. no no, that's not true, yes you need to write your images with a forward slash / instead of a back slash \, but all web servers, windows, macs, unix etc can use the / in front all this says is to start in the web root directory, which is usually public_html or htdocs or some such, and then go into the images directory which is within the web root directory, then open up shimTrans01.gif. All web servers allow this syntax.

    Cheers!

  4. #4
    meerk
    Guest
    Quote Originally Posted by Murlyn
    can use the / in front all this says is to start in the web root directory, which is usually public_html or htdocs or some such, and then go into the images directory which is within the web root directory, then open up shimTrans01.gif.
    Not quite true unfortunately. You need to put in a couple of 'dots' before the first 'forward slash'

    eg (from your code)
    img src="\images\shimTrans01.gif"

    …this should be
    img src="../images/shimTrans01.gif"

    This is assuming that both the 'page' and 'images' folders are in the same directory.
    Hope this helps

    meerk…

  5. #5
    Re: Displaying graphics
    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    Quote Originally Posted by meerk
    Not quite true unfortunately. You need to put in a couple of 'dots' before the first 'forward slash'

    eg (from your code)
    img src="\images\shimTrans01.gif"

    …this should be
    img src="../images/shimTrans01.gif"

    This is assuming that both the 'page' and 'images' folders are in the same directory.
    Hope this helps

    meerk…
    Actually a couple dots with a forward slash ../ means go back one directory, it does not mean go back to the web root.. so for instance if your directory structure was like this:

    /public_html/forums/macforum/webdesign/

    And you had an html document within the webdesign directory and you wanted to access an images directory within the macforum directory you could make your link three ways:

    1) <img src="http://www.example.com/forums/macforum/images/test.gif" />
    This is an absolute link

    2) <img src="../images/test.gif" />
    This is a relative link

    3) <img src="/forums/macforum/images/test.gif" />
    This also is a relative link

    The first one takes the absolute link, finds the server, even though it's localhost and outputs your image.. this actually takes more time since it has to do a dns lookup, etc etc on the domain name.

    The second knows that it is on the same server so does not have to do a dns lookup. and it says.. go back one directory "macforum" then within the "macforum" directory go into the "images" folder.. now if your images folder was in the "forums" directory you could do this <img src="../../images/test.gif" /> which means go back two directories then go into the images directory.

    The third by using the first slash to go to the web server root, not the machine root this is done by the server software to prevent people from surfing through your file structure, then it says go to the macforum directory, then the images directory then show test.gif

    Cheers!

  6. #6
    meerk
    Guest
    You're right, but…
    …I still think that it's something to do with those 'backslashes' and starting off the path with one of them??

    Anyways it's late and I'm fed up marking-up our company's new site.

    I'll take another look tomorrow and ponder…

    meerk

  7. #7
    Re: Displaying graphics
    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    I havent looked at his code yet.. so I guess I might as well do that and help him out At least he understands the way directory structure works now.

    Ok he has only one problem.

    Change
    <img src="images\floodLogo02.jpg">

    To
    <img src="images/floodLogo02.jpg">

    And your page will show up the way you want it

    Cheers!

    Rick

  8. #8
    Re: Displaying graphics
    muso's Avatar
    Member Since
    Jan 15, 2003
    Location
    Whangarei, New Zealand
    Posts
    2
    Specs:
    Pwnt
    While it is supported to add a '/' in front of any path, it is not general practice.

    What you should do marlonolram (if this isn't your setup at the moment), is have all your html/php/xhtml files in one folder (normally your root directory) and inside the root directory have one folder named images. I find this is the easiest way to manage links. That way, any internal file links can just be linked to with their file name, and all images just have a "images/" before them.

    Always use foward slashes, and remember to define a base uri if you're using relative links.
    I'm in your forums, writing sentences in a grammatically acceptable manner.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. displaying on my TV
    By flyboyy in forum Apple Desktops
    Replies: 4
    Last Post: 04-06-2015, 06:37 PM
  2. Replies: 6
    Last Post: 05-02-2011, 08:12 PM
  3. Replies: 1
    Last Post: 04-04-2011, 11:26 PM
  4. Displaying accents
    By Ballu in forum OS X - Operating System
    Replies: 7
    Last Post: 01-02-2010, 03:57 PM
  5. displaying different IP
    By jonn in forum OS X - Operating System
    Replies: 2
    Last Post: 03-02-2009, 08:51 PM

Posting Permissions

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