Jan 10, 2001, 2:22 PM
Post #4 of 5
Ok just checking there.
First you must open the file, then separate the top and bottom from each other with those tags. So if your using tags like these:
<!-- Start -->
<!-- End -->
Then use this code.
$file .= "$_";
($top,$crap)=split(/<!-- Start -->/, $file);
($content,$bottom)=split(/<!-- End -->/, $crap);
Now you have to top html in $top and the bottom in $bottom, so now you have to take the input passed to you script and append it to the content between the tags, like so,
$content .= qq~
A table with the input passed to your script.
Now you can overwrite the html file with the new content.
You'll have to put the tags back in because when we used them to split up the file they were taken out.
$tag = "<!-- Start -->";
$tag2 = "<!-- End -->";
print data2 "$top$tag$content$tag2$bottom";