Best way to use a header include file?

Discussion in 'HTML' started by John Dalberg, Sep 20, 2005.

  1. John Dalberg

    John Dalberg Guest

    I created a header file to be included in every webpage. The header file
    has images that have a path to an "images" folder off the root folder.
    However if I use this header file for web pages that reside in subfolders,
    I have to change the path of all the image links to '../images/' instead of
    'images/'.

    What's the best way to have a single header file which *any* web page,
    regardless of its location, can use without modifying it to suit certain
    webpages depending on their location?

    --
    John Dalberg
     
    John Dalberg, Sep 20, 2005
    #1
    1. Advertising

  2. John Dalberg

    rf Guest

    John Dalberg wrote:
    >
    > I created a header file to be included in every webpage. The header file
    > has images that have a path to an "images" folder off the root folder.
    > However if I use this header file for web pages that reside in subfolders,
    > I have to change the path of all the image links to '../images/' instead

    of
    > 'images/'.
    >
    > What's the best way to have a single header file which *any* web page,
    > regardless of its location, can use without modifying it to suit certain
    > webpages depending on their location?


    /images/

    Cheers
    Richard.
     
    rf, Sep 20, 2005
    #2
    1. Advertising

  3. John Dalberg

    boclair Guest

    John Dalberg wrote:
    >
    > I created a header file to be included in every webpage. The header file
    > has images that have a path to an "images" folder off the root folder.
    > However if I use this header file for web pages that reside in subfolders,
    > I have to change the path of all the image links to '../images/' instead of
    > 'images/'.
    >
    > What's the best way to have a single header file which *any* web page,
    > regardless of its location, can use without modifying it to suit certain
    > webpages depending on their location?
    >

    Is this PHP you are talking about? In that case at least header
    locations MUST be absolute and is usually advisable.

    For PHP, see http://au3.php.net/header

    Louise
     
    boclair, Sep 20, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alan Silver

    Re: Best way to use a header include file?

    Alan Silver, Sep 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    445
    Alan Silver
    Sep 27, 2005
  2. Aguilar, James
    Replies:
    2
    Views:
    707
    Aguilar, James
    Jul 16, 2004
  3. Victor Bazarov

    #include "file" -vs- #include <file>

    Victor Bazarov, Mar 5, 2005, in forum: C++
    Replies:
    4
    Views:
    550
    Exits Funnel
    Mar 6, 2005
  4. Andreas Bogenberger
    Replies:
    3
    Views:
    959
    Andreas Bogenberger
    Feb 22, 2008
  5. mlt
    Replies:
    2
    Views:
    881
    Jean-Marc Bourguet
    Jan 31, 2009
Loading...

Share This Page