Forum Moderators: coopster
I don't want to load these files in and edit their texts on their way out to the browser.
Is there any way of setting a base URI for a subsection of an HTML file? This would make the links fix up correctly.
You have your index.php page that you are including content.php into. In index.php and content.php you set all your links like
<?php echo ($root . "folder/filetoinclude.php");?>
At the top of all your main pages (index.php in each folder or whatever) you set the root like this
<?php $root = './../';?>
with the correct number of back folder ../'s to make the links work in that folder.
When you include a file it forgets where it has come from and thinks it is in the same folder as the page that includes it. Therefore if you include it in several pages that are at different levels of sub folders the links will be broken unless you do the above or hard code all your links.
Since I'm running PHP includes (tried virtual too, no better), I could perhaps put those in as a prefix... I suppose if the PHP were not including the file, the <?php echo ...?> sections would just disappear and leave the links alone.
But I really want the pages to be completely HTML, no php scripting and no funny link syntax. This makes it easier for simpletons like me... In particular, it lets Netscape Composer and Adobe GoLive resolve and patch links correctly.
The links and images all work correctly when the main URL is in the same directory as the pages that carry the links. But my php script spelunks down through directories and then the links/images break.
I guess what I would consider most ideal would be if the <BASE HREF> tag were usable in subsections of the HTML <BODY> section, or anything like. I know what the base URL for the directory is, and I could easily set it and end-tag it around the file includes.
Thoughts?