Hi,
I have a file saved in my root folder called topsection.asp that contains the line:
<img src="graphics/logo.gif">
Then in my index.asp file I have the line:
<!--#include file="topsection.asp"-->
This works fine if topsection.asp and index.asp are in the same folder. If they're not (eg index.asp is in a subfolder called 'reports') and I change index.asp to:
<!--#include file="../topsection.asp"-->
then the path to the graphic is wrong. I tried to get round this by specifying the absolute path to the file in topsection.asp - eg:
<img src="
This fine but then when I upload the files to the website the file path to logo.gif is obviously wrong. Is there a way round this so I can get the best of both worlds - eg be able to call my include file from any folder or subfolder and the file paths all work ALSO for it to work on both my home server and my hosted website without changing any code?
Thanks very much
Ed
I have a file saved in my root folder called topsection.asp that contains the line:
<img src="graphics/logo.gif">
Then in my index.asp file I have the line:
<!--#include file="topsection.asp"-->
This works fine if topsection.asp and index.asp are in the same folder. If they're not (eg index.asp is in a subfolder called 'reports') and I change index.asp to:
<!--#include file="../topsection.asp"-->
then the path to the graphic is wrong. I tried to get round this by specifying the absolute path to the file in topsection.asp - eg:
<img src="
This fine but then when I upload the files to the website the file path to logo.gif is obviously wrong. Is there a way round this so I can get the best of both worlds - eg be able to call my include file from any folder or subfolder and the file paths all work ALSO for it to work on both my home server and my hosted website without changing any code?
Thanks very much
Ed