habe ein Problem, mein Vorschau Modus funktioniert nicht, warum nicht?
MfG Marcel
PHP:
<?php
error_reporting(E_ALL);
?>
<html>
<head>
<title>Gästebucheintrag schreiben</title>
<style type="text/css">
body, table, form, p {font-family: Arial}
</style>
<meta name="author" content=".*.*.">
</head>
<body text="#000000" bgcolor="#8dc7c7" link="#000000" alink="#000000" vlink="#000000">
<div align="center">
<table border="1" style="width:500px">
<tr>
<td>
<h1 style="text-align:center">Mein Gästebuch</h1>
<?php
if (!empty($fehler)) {
$anzeigen = false; // keine Anzeige des Gästebuchs
echo "<p><b>Leider wurde Ihr Beitrag nicht angenommen werden:</b></p>";
echo "<ul>$fehler</ul>";
} elseif ($status == "Vorschau") {
$anzeigen = false; // keine Anzeige, da Vorschau
$datum = date("\a\m j.n.Y \u\m H:i");
?>
<h3>So sieht Ihr Eintrag derzeit aus:</h3>
<hr noshade width="150">
<p><?php htmlentities($eintrag) ?></p>
<p>
<small><b><?php htmlentities($autor).". $datum" ?></b></small>
</p>
<hr width="150px" noshade>
<p>
<b>Um Ihren Beitrag zu bearbeiten, benutzten Sie bitte das Formular.</b>
</p>
<?php
} elseif ($status == "Eintragen") {
$query = "INSERT INTO guestbook SET
datum = now(),
eintrag ='".addslashes($eintrag)."',
autor = '".addslashes($autor)."'
";
$sql = mysql_query($query)
or die(mysql_error());
}
if ($anzeigen) {
$query = "SELECT DATE_FORMAT(datum,'am %e. %c. %Y um
%k:%i') AS datum, eintrag, autor FROM guestbook
ORDER BY datum DESC";
$sql = mysql_query($query)
or die(mysql_error());
while ($ds = mysql_fetch_object($sql)) {
$eintrag = $ds->eintrag;
$autor = $ds->autor;
$datum = $ds->datum;
?>
<p><?php format($eintrag) ?></p>
<p><small><b><?php htmlentities($autor).". $datum" ?></b></small></p>
<hr width="150px" nosheade>
<?php
}
unset($eintrag,$autor);
}?>
<form action="guestbook.php" method="post">
<p>
<small><b>Ihr Eintrag (maximal <?php $grenzwert ?> Zeichen):</b></small><br>
<textarea style="width:500px; height:240px" name="eintrag"><?php htmlentities($eintrag)?>
</textarea>
</p>
<p>
<small><b>Ihr Name:</b></small><br>
<input style="width:500px;" type="text" maxlength="50" name="autor" value="<?php htmlentities($autor)?>">
</p>
<p>
<input type="submit" name="status" value="Vorschau">
<input type="submit" name="status" value="Eintragen">
</p>
</form>
</td>
</tr>
</table>
</div>
</body>
</html>
MfG Marcel