SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Inludes Not Loading

    I'm frantically working on my band website as we have a gig coming up and we have advertised the new web address. However, whenever I have a page located in a sub folder the includes do not seem to load.

    Can anyone shed any light on this please?

    http://www.thebakerstreetirregulars....allabout.shtml

  2. #2
    SitePoint Addict
    Join Date
    Dec 2004
    Location
    Charlotte
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you using relative paths?

  3. #3
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Of course.

    The files on the root refer to them like this:
    <!--#include file="includes/header.shtml" -->

    The file in the folder called" media" refer to them like so:
    <!--#include file="../includes/header.shtml" -->

    I think I have been staring at this website for far too long, was up till 3am last night building it.

  4. #4
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    UK, London
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try
    <!--#include file="/includes/header.shtml" -->

    That should work for the lot.
    Chris Heilmann
    Blog | Articles | Binaries

  5. #5
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    UK
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might like to know that the lyrics link at the end of the paragraph on the media page is broken.

    If you still have your original problem, could we have a link to the raw code, i.e., none-processed.

  6. #6
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    definately looks like a path problem Nicky .... seen them before. I think adding the / before the call to includes should solve it AS LONG AS the includes folder is on the root of the server.

  7. #7
    SitePoint Zealot metho's Avatar
    Join Date
    Feb 2005
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On a nix server, the relative path to same dir needs the "/"

    <!--#include file="/includes/header.shtml" -->

    ; on a windows server you don't.

    <!--#include file="includes/header.shtml" --> or
    <!--#include file="/includes/header.shtml" -->

    (Hope I remembered that the right way)

    This problem is a pain in the *** when migrating or developing on different server operating systems. Most developers bypass the issue by loading a the site's URL as a var e.g. [psudo code]

    root = 'http://www.thebakerstreetirregulars.com/'

    Applied above, the include URL would be;

    <!--#include file= root+"includes/header.shtml" -->


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
  •