There are several ways to do what you want.
a) have an index.php file, which is the index.html file, but in the location where you want the links.txt, you have the code:
<?php include("links.php"); ?>
b) Use a template-style system. Have your index.php file read the index.html file into a variable, say $index_file. Then use
$index_file = str_replace($find, $replace, $index_file);
You can do the same thing for your unique codes:
$index_file = str_replace("007", "Data 007", $index_file);
3) Use PHP template. There's an article at this site about FastTemplate, http://php.resourceindex.com/ has links to several, and I've got my own basic template that you could use.