ecco il codice php:
Codice PHP:
<?php
$nomefile="$url/index.php";
$vecchiofile=fopen($nomefile, "r");
$contenuto_file=fread($vecchiofile, filesize($nomefile));
fclose($vecchiofile);
$data=(date("d-m-Y"));
$ora=(date("H:i:s"));
$f=fopen($nomefile, "w+");
fwrite($f, "<td width=\"450\" bgcolor=\"#FFFFFF\">
<font color=\"#62B8FF\" size=\"4\" face=\"Arial, Helvetica, sans-serif\">$nome $cognome</font></td>\r\n");
fwrite($f, "<td width=\"450\" bgcolor=\"#FFFFFF\">
<font color=\"#62B8FF\" size=\"4\" face=\"Arial, Helvetica, sans-serif\">$data alle $ora</font></td>\r\n");
fwrite($f, "<td width=\"450\" bgcolor=\"#FFFFFF\">
<font color=\"#62B8FF\" size=\"4\" face=\"Arial, Helvetica, sans-serif\">$messaggio</font></td>\r\n");
</html>\r\n");
fwrite($f, "</tr></table>\r\n");
fwrite($f, "<br>\r\n");
fwrite($f, "$contenuto_file\r\n");
fclose($f);
?>
ecco il secondo:
<?php
$nomefile="$url/index2.php";
$vecchiofile=fopen($nomefile, "r");
$contenuto_file=fread($vecchiofile, filesize($nomefile));
fclose($vecchiofile);
$data=(date("d-m-Y"));
$ora=(date("H:i:s"));
$f=fopen($nomefile, "w+");
fwrite($f, "<td width=\"450\" bgcolor=\"#FFFFFF\">
<font color=\"#62B8FF\" size=\"4\" face=\"Arial, Helvetica, sans-serif\">$nome $cognome</font></td>\r\n");
fwrite($f, "<td width=\"450\" bgcolor=\"#FFFFFF\">
<font color=\"#62B8FF\" size=\"4\" face=\"Arial, Helvetica, sans-serif\">$data alle $ora</font></td>\r\n");
fwrite($f, "<td width=\"450\" bgcolor=\"#FFFFFF\">
<font color=\"#62B8FF\" size=\"4\" face=\"Arial, Helvetica, sans-serif\">$messaggio</font></td>\r\n");
</html>\r\n");
fwrite($f, "</tr></table>\r\n");
fwrite($f, "<br>\r\n");
fwrite($f, "$contenuto_file\r\n");
fclose($f);
?>
ma mi va solo il primo come mai?