I have written a search engine script using PHP ie accessing http://www.test.com/catalogue/chairs/a.html
calls a PHP script called "catalogue" that passes in the values "chairs" and "a.html". My script then goes into the directory "chairs/a.html" and spits out the information after inserting them into a template html page to make it fit the theme of my website. The problem is that paths all seem to be wrong and all the images and CSS style sheet links are invalid. If I just for debugging sake hardcoded "chairs" and "a.html" as parameters within the script then just called
everything is displayed correctly! so the "/chairs/a.html" appended after the url is causing the invalid paths. How can I fix this? I don't really want to make use of absolute paths in my theme page.