Page 1 of 1

[56K WARN] include question

Posted: Sun Jul 23, 2006 1:55 pm
by speedy33417
I want to include a header and footer file into my pages. However I have my structure set up in different folders that have more folders. (see img below)
What's the best way to make sure that my links work on each level of my library?

Right now I have my inc file in the image folder on the top level. Ho do I link to images to work on every level?
I'd rather not create image folders for every library that I create and upload every image that use in my inc file to each of them.
I'd also like to avoid pulling them from a database. What other solution do I have?

Image

Posted: Sun Jul 23, 2006 1:58 pm
by feyd
$_SERVER['DOCUMENT_ROOT'] maybe?

Posted: Sun Jul 23, 2006 2:41 pm
by speedy33417
How do I use that? That's a little advanced for me. I post my include file here. Or should I just use direct path?

Code: Select all

<div align="center">
      <table border="0" width="780" cellspacing="0" cellpadding="0">
            <tr>
                 <td><img border="0" src="images/header.inc" width="780" height="80"></td>
            </tr>
      </table>
</div>
So this would work on my main page, but when I use this one level up, it doesn't.

Posted: Sun Jul 23, 2006 2:45 pm
by feyd
You're talking in a web page? Well that's a completely different animal: /images will suffice most often.

Posted: Sun Jul 23, 2006 2:58 pm
by speedy33417
Yeah, but that's the thing it's not working.

I only have one image folder directly in my mainwebsite_html folder.

This will work as long as I stay in that directory, but if I leave that say going in to mysite.com/something/ folder than the links won't work.

Hope this clears up my question a little.

Thanks.

Posted: Sun Jul 23, 2006 3:01 pm
by Luke