SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jan 2007
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Diffrent Directories Linking To Images

    I have a root directory and then in this I have a directory called biography.

    What I want to do is include a folder in the root folder called includes which will include a couple of images I want to appear on all pages.

    Now the problem I have is how do I get the sub section to link to the images???

    This is the code in my subsection which is a server side include

    Code:
    <div id="left">
    <?php include("../includes/leftside.php")?>
    </div>
    Then this is my include code which works at the moment for all pages in my root directory but at the moment I can't get the subsection biography pages to include these images.

    Code:
    <a href="about.php"><img src="images/biography/test.gif" alt="test" class="biography-img" /></a>
    is it possible???

    Cheers

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to use a root-relative URI for the image:
    Code:
    <img src="/images/biography/test.gif" alt="test" class="biography-img">
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Addict
    Join Date
    Jan 2007
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers that works perfectly


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
  •