<? $gaestebuchdb="gaestebuch.txt"; if(!file_exists($gaestebuchdb)) { $fp=fopen($gaestebuchdb,"w" fclose($fp); } if(isset($abschicken)) { $fpn=@fopen($gaestebuchdb.".tmp","w" if($fpn<=0) { ?> Fehler <? } $text=htmlspecialchars($text); $datum=date("d.m.Y H:i:s" $eintrag= "<tr><td>$text</td></tr>"; $eintrag.="<tr><td><font size='-1'>$name, $email $datum</font></td></tr>"; $eintrag.="<tr><td><hr></td></tr>\n"; fputs($fpn,$eintrag); $fp=@fopen($gaestebuchdb,"r" if($fp<=0) { ?> Fehler <? } while(!feof($fp)) { $zeile=fgets($fp,32000); fputs($fpn,$zeile); } fclose($fp); fclose($fpn); unlink($gaestebuchdb); rename($gaestebuchdb.".tmp",$gaestebuchdb); } ?> <form action="gaestebuch.phtml" method="POST"> <input type="Text" name="email" size="30" maxlength="255"> <textarea name="text" cols="30" rows="10"></textarea> <input type="Submit" name="abschicken" value="Abschicken"></td> </form> <? include($gaestebuchdb); ?>