Hello,
I want to use old html files (in directories) within a php page, which automatically generates php files which would include the html files.
an html directory looks like:
topic1 (directory)
topic1.html
graph1.jpg
graph2.jpg
graph3.jpg
My idea is that I can use a php script, which would recursively check all the sub-directories, grab the html files; and generate php files in each directory.
The genreated php file would look like:
<?php
include 'header.php';
include 'topic1/topic1.html';
include 'footer.php';
?>
This would work EXCEPT when the html files have images files listed.
That is,
if, in the html code, there is a <img srg="graph1.jpg"> tag. the included topic1.html file would not render the graphic file at all since it seeks the root directory only.
If I change the code to:
<img src="from/directory/heirechy/graph1.jpg">
This would work fine. But, if I do this, I would not be able to use the html files as they are 🙁
Is there a remedy for this?
Thanks for your reading and I would appreciate any input!!!