The idea of using an HTML file as a database will have serious problems.
There are two big problems.
Making sure that only one process updates the file at any given time.
If more than one process updates the file at the same time, the file will get corrupted or it won't record all the updates.
Finding the right line to delete. You will need a way to unambiguously identify the line to delete.
Assuming you have some sort of user id, you could put that into the html.
<!-- BEGIN -->
<p data-id="1">Promethus</p>
<p data-id="2">Orpheus</p>
<p data-id="99">Tantalus</p>
<p data-id="11895">Marcus</p>
<!-- END -->
Delete the line.
// WARNING ! This function can ONLY be called by one process at a time.
function deleteLine($file, $id)
{
$tmpfile = $file . '.tmp';
$fp = fopen($file, 'r');
$fpout = fopen($tmpfile, 'w');
while ( $line = fgets($fp, 1000) ) {
// only write lines that are not the id we are searching for
if ( ! preg_match("/data-id=\"$id\"/", $line) {
fwrite($fpout, $line . "\n");
}
}
fclose($fp); fclose($fpout);
rename($tmpfile, $file);
}