Inline Code Example HereHi,
the php code which
<html>
<body>
<?php
$fs =fopen("comments.txt",'a');
$jina = $_POST["fname"];
$message = $_POST["message"];
$time = date("d/m/y : H:i:s", time()) ;
//limit leght characters
//$message = wordwrap($message, 5);
fwrite($fs,$message);
fwrite($fs, "\n<i>Posted By </i> ".$jina." <i>on </i>");
fwrite($fs, $time);
fwrite($fs, "<hr />");
$fs= fopen("comments.txt", 'r');
while (!feof($fs))
{
echo fgets($fs)."<br />";
}
fclose($fs);
/*<html>
<body onLoad="location.href='#chini'">
//<a name="chini"> </a>
</body>
</html>
*/
?>
</body>
</html>
writes the contents to the txt file, but the problem is when I click refresh button it writes the data as many times as I refresh the page. how can I avoid it.
Regards