SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru
    Join Date
    Jul 2002
    Location
    space
    Posts
    845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    simple image directory question

    hey - I have a folder called /admin.

    Some of the files in /admin are html pages which have images. I would prefer the images to be called from the root directory, so that I only have to have 1 image folder on my site.

    So how can I call these images in /admin without naming my images "<img src="http://www.mysite.com/images/image.gif">"?

    Thanks.

  2. #2
    Non-Member
    Join Date
    Apr 2006
    Location
    Scotland
    Posts
    325
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <img src="/images/poo.gif">

    That will go to your root directory then into your main images folder.

  3. #3
    SitePoint Guru
    Join Date
    Jul 2002
    Location
    space
    Posts
    845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So all I have to do is add "/" in front of all images in admin?

  4. #4
    Non-Member
    Join Date
    Apr 2006
    Location
    Scotland
    Posts
    325
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes. "/" takes you to the home of the publicly viewable directory (ie public_html).

    You dont need to write
    src="http://www.mysite.com/whatever"
    Instead write
    src="/whatever"

    Same for links

  5. #5
    SitePoint Guru
    Join Date
    Jul 2002
    Location
    space
    Posts
    845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks

  6. #6
    SitePoint Guru
    Join Date
    Jul 2002
    Location
    space
    Posts
    845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm.. I tried doing this but it isn't working.

    I have a folder called "test"

    in it, I have the images called like this: <img src="/images/image.gif">

    image.gif IS in my main image folder.

    Yet the image comes out broken for some reason? Any reason why?

  7. #7
    SitePoint Guru
    Join Date
    Jul 2002
    Location
    space
    Posts
    845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm.. I tried doing this but it isn't working.

    I have a folder called "test"

    in it, I have the images called like this: <img src="/images/image.gif">

    image.gif IS in my main image folder.

    Yet the image comes out broken for some reason? Any reason why?


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
  •