Hi there.
I have an included file (header.php) that contanis a reference to a graphic.
If I stay at the root level, then I can control the relative path of the
image.
eg. images/imagename.jpg
However, if I include this file (header.php) in a lower level directory then
of course, I end up with no image displaying as the relative path is no
longer correct.
Currently I am using the following to provide an absolute path to the image.
$path = "http://".$_SERVER["HTTP_HOST"]."/images/";
$image = $path."imagename.jpg";
echo "<img src=\"$image\">";
This works fine, but looks klunky.
I would like to avoid specifying an absolute hardcoded path name so I can
load this function on any site I choose.
Any suggestions as to how to get images displaying when including a
header.php file in a lower lever directory?
Your assistance is appreciated.
Peter.