Kod: Zaznacz cały
<html>
<head>
</head>
<body>
<h1>Księga gości</h1>
<form action=ksiega_zapisz.php>
Wpisz swój komentarz<br>
<textarea cols=40 rews=15 name=komentarz></textarea><br>
<input type="text" name=podpis>Podpis<br>
<input type="submit" value="Zapisz">
</form>
<?php
if(file_exists("ksiega_wpisy.txt"))
readfile ("ksiega_wpisy.txt");
else
echo ( "masz szanse byc pierwszy");
?>
</body>
</html>
Kod: Zaznacz cały
<?php
if(file_exists("ksiega_wpisy.txt"))
fopen("ksiega_wpisy.txt","a");
else
$plik=fopen("ksiega_wpisy.txt","w");
fwrite($plik,"<hr>$komentarz<br>$podpis<br>");
fclose($plik);
?>