Use Include Files

I've created two separate files that I use as includes to display the header and footer of each page.Everything works fine if the pages that contain the includes remain in the same directory: the root directory. However, I want to use the includes in other places but I can't figure out a good way to solve the problem of the paths that are in the actual include files (path to stylesheet in the header, etc.).
Here is my basic directory structure on the web server (I've used "code" to make it easier to read):
Code:
- root
- include
header.asp
footer.asp
+ images
- misc
contact.asp
index.asp
I want to use the same include files in contact.asp but, obviously, the paths are going to be wrong. I've tried using Server.MapPath in the paths of header.asp and footer.asp so that the includes can be used anywhere in the site but, it is not working.And, I don't want to have the physical path visible in the source code. Is there a function or method I don't know about that can give me a path to the "root"?What have you done if in a similar situation?

View Replies




Copyrights 2005-15 www.BigResource.com, All rights reserved