Best way to use a header include file?

J

John Dalberg

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?
 
R

rf

John said:
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.
 
B

boclair

John said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top