Hi,
Was is hier dran falsch?
->
Was is hier dran falsch?
->
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Guestb00k</title>
</head>
<body>
<center>
<form action="guest.php" method="post"
name="form1" id="form1">
<p>
<input type="text" name="name" id="name" value="Name" size="15" maxlength="15" />
<br />
<textarea name="text" cols="50" rows="5">
<?php echo "Hier dein Text"; ?>
</textarea><br />
<input type="submit" name="button" id="button" value="Absenden" />
</form></p>
<br />
<hr />
<?php
$name = $_POST['name'];
$text = $_POST['text'];
$datei = "gb.txt";
$fp = fopen($datei, "a+");
$name = htmlspecialchars(stripslashes($name));
$text = htmlspecialchars(stripslashes($text));
$datum = date("H");
$put = "$name schrieb um $datum Uhr : \n <br /> $text \n <br /><br />";
if(isset($name) && isset($text)) {
fputs($fp, $put, $datei);
}
$geschrieben = @fgets($fp, $datei);
echo $geschrieben;
fclose($fp);
?>
</center>
</body>
</html>