I have encountered a PATH problem when building a small web site. The site consists of a few standard pages in different folders and a few others in a folder named _include. I now have three files included on each page - menu.php, header.php and footer.php - all three contained in the folder _include. I have used set_include_path and it works quite well as far as PHP goes. However, there are problems when it comes to HTML. In the header.php file I have this syntax <img src="_pics/header.png" width="XXX" height="YYY" />
The code works fine and the picture loads as long as all the files that includes header.php are in the same directory. But if I try to include it in a page in a subdir, then the picture doesn't load, which is pretty obvious, seeing as the directory level now has changed.
So my question is how can I solve this issue so that HTML-paths work in included PHP-files, regardless of where they are placed on the site?