Zitat
<form action="newreply.php" method="POST" target="_self">
<div class="div">Name: <p align="center"><input name="name" size="40"></p></div>
<div class="div">E-Mail: <p align="center"><input name="email" size="40"></p></div>
<div class="div">Kommentar:<br><p align="center"><textarea name="commentar" cols="40" rows="12" wrap="physical"></textarea></p></div>
<p align="center"><input type="submit" name="Absenden" id="button" value="Absenden"></p>
</form>
<hr>
<?php
$beitrag = file("guestbook.txt");
krsort($beitrag);
foreach($beitrag as $ausgabe)
{
$ausgabe = stripslashes($ausgabe);
$zerlegen = explode("|", $ausgabe);
echo "
<table align=\"center\"
border=\"0\" cellspacing=\"0\"
cellpadding=\"5\" width=\"50%\">
<tr>
<td>
Von <a href=\"mailto:$zerlegen[0]\">$zerlegen[1]</a>
am $zerlegen[2]
</td>
</tr>
<tr>
<td><br>
$zerlegen[3]
</td>
</tr>
</table><br>
<hr>
";
}
?>
|
|
PHP-Quelltext |
1 2 |
$beitrag = file("guestbook.txt");
krsort($beitrag);
|
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
foreach($beitrag as $ausgabe)
{
$ausgabe = stripslashes($ausgabe);
$zerlegen = explode("|", $ausgabe);
echo "
<table align=\"center\"
border=\"0\" cellspacing=\"0\"
cellpadding=\"5\" width=\"50%\">
<tr>
<td>
Von <a href=\"mailto:$zerlegen[0]\">$zerlegen[1]</a>
am $zerlegen[2]
</td>
</tr>
<tr>
<td><br>
$zerlegen[3]
</td>
</tr>
</table><br>
<hr>
";
}
|
Zitat
<?
$user = $_POST["name"];
$user = htmlentities($user);
$email = $_POST["email"];
$email = htmlentities($email);
$comment = $_POST["commentar"];
$comment = htmlentities($comment);
$comment = str_replace("\n", "<br>", $comment);
if ($user == "" and $comment == "")
{
echo "<font color=\"red\">Sie müssen das Feld \"Namen\"
und \"Kommentar\" ausfüllen</font>";
}
else
{
$datum= date("d.m.Y H:i:s");
$eintrag="$email|$user|$datum|$comment";
$datei = fopen("guestbook.txt", "a");
fwrite($datei, "\n".$eintrag);
fclose($datei);
echo "<font color=\"green\">Dein Eintrag wurde erfolgreich gespeichert</font>";
}
?><br><br>
<a href="guestbook.php">zurück zum Gästebuch</a>
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 |
$user = $_POST["name"];
$user = htmlentities($user);
$email = $_POST["email"];
$email = htmlentities($email);
$comment = $_POST["commentar"];
$comment = htmlentities($comment);
$comment = str_replace("\n", "<br>", $comment);
|
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
if ($user == "" and $comment == "")
{
echo "<font color=\"red\">Sie müssen das Feld \"Namen\"
und \"Kommentar\" ausfüllen</font>";
}
else
{
$datum= date("d.m.Y H:i:s");
$eintrag="$email|$user|$datum|$comment";
$datei = fopen("guestbook.txt", "a");
fwrite($datei, "\n".$eintrag);
fclose($datei);
echo "<font color=\"green\">Dein Eintrag wurde erfolgreich gespeichert</font>";
}
|
|
|
PHP-Quelltext |
1 2 3 |
$datei = fopen("guestbook.txt", "a");
fwrite($datei, "\n".$eintrag);
fclose($datei);
|

Benutzerinformationen überspringen
Registrierungsdatum: 24. März 2008
Wohnort: Castrop-Rauxel
WBB Version: alle
Forensoftware: Burning Board® 3.1.7, entwickelt von WoltLab® GmbH