Hi. I have a problem modifying a .htm file. I want append a lines to this file, but my code overwrite the following line, I send the code of the problem.
<?PHP
$file = fopen ("05ins02s.htm", "r+b");
if (!$file) {
echo "<p>No puede abrir archivo $file.\n";
exit;
}
while (!feof ($file)) {
$line = fgets ($file, 1024);
if (eregi ("head", $line, $out)) {
fwrite($file, "SOY PCM");
break;
}
}
fclose($file);
more 05ins02s.htm (this file is the original)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD
0/strict.dtd">
<HTML LANG=sp>
<HEAD>
<TITLE>Particiones</TITLE>
---------------------&&&&&&&&-------
more 05ins02s.htm (this result with my code), here i want that append (SOY PCM) and overwrite !!!! (help me)...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http:
0/strict.dtd">
<HTML LANG=sp>
<HEAD>
SOY PCM>Particiones</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html">
Thanks Boys..