I have my photography site as so (truncated):
Code: Select all
photography:
blog.php bota.php contact index.php logout mia.php mibb.php register styles top.php
bot.php conf.php functions.php login lord-of-frogs mib.php photos script.php terms.php usercp
photography/contact:
index.php
photography/login:
forgot_password.php index.php
photography/logout:
index.php
photography/admin:
[admin pages]
photography/photos:
bak.view_category.php comments.php files index.php rateme.php select_category.php view.php view_cat.php view_image_a.php view_image_b.php
photography/photos/files:
[images] prevs_lg prevs_sm
photography/photos/files/prevs_lg:
[large thumbs]
photography/photos/files/prevs_sm:
[small thumbs]
photography/register:
confirm.php index.php
photography/styles:
default
photography/styles/default:
[site images] style.css
photography/usercp:
index.php
where top, bot, mia, mib, mibb, and bota are sorta like your header files. Then whenever I have an image in the style, I'll do:
Code: Select all
$HTML .= "<img src='/styles/".STYLE."/image.jpg' alt='example' />"; // where STYLE is defined as a folder name
The trick is the leading /. I use top.php in every page. So..
Code: Select all
# /index.php
require('top.php');
# /photos/index.php
require('../top.php');
And the images work fine in each. If, on the other hand, I left out the leading slash, it would try to load as so:
Code: Select all
<img src='styles/default/image.jpg' />
would load /photos/styles/default/image.jpg, but
<img src='/styles/default/image.jpg' />
will always load /styles/default/image.jpg
I probably gave you too much info, but you asked how other people had things set up. ^^;