CHAKKA1992
Mitglied
Hallo,
auf meine Homepage habe ich mir mein Gästebuch selbst Programmiert. Nun wird aber jedes mal wenn die Seite geladen wird ein Neuer Eintrag erstellt, ohne jediglichen Inhalt.
HP: http://stumppi.st.funpic.de/page_buch.php
Woran liegt das? Ich hab es Schon einmal mit einer If-Schleife probiert...
MFG
chakka1992
PS: Learning By Doing
auf meine Homepage habe ich mir mein Gästebuch selbst Programmiert. Nun wird aber jedes mal wenn die Seite geladen wird ein Neuer Eintrag erstellt, ohne jediglichen Inhalt.
HP: http://stumppi.st.funpic.de/page_buch.php
PHP:
<form name="form1" method="post" action="page_buch.php">
Name: <input type="text" name="name"><br>
E-Mail: <input type="text" name="email"><br>
Homepage:<input type="text" name="Homepage"><br><hr size="1"><textarea name="entry" cols="60" rows="5"></textarea><br>
<input name="EINTRAG HINZUFÜGEN" type="submit" value="EINTRAG HINZUFÜGEN"><input name="EINTRAG LÖSCHEN" type="reset" value="EINTRAG LÖSCHEN"></form><hr size="4" color="#FFCC33">
<?
@$name = $_POST['name'] . "\r\n";
@$text = $_POST['entry'] . "\r\n";
@$web = $_POST['Homepage'] . "\r\n";
@$mail = $_POST['email'] . "\r\n";
if($web == "")
{
$link = "Homepage von ";
}
else
{
$link = "<a href='http://" . $web . "'>Homepage</a> von";
}
if($mail == "")
{
$email = "E-Mail";
}
else
{
$email = "<a href='mailto:" . $mail . "'>E-Mail</a>";
}
$vor_end = "<table width='100%' border='1' bordercolor='#000000' bordercolorlight='#666666'><tr><td background='pictures/top/oben.JPG'>" . $name . "</td></tr><tr><td bgcolor='#000000'><p>" . $text . "</p></td></tr><tr><td background='pictures/top/unten.JPG'>" . $email . " " . $link . $name . "</td></tr></table><br>";
if($name == "")
{
if($text == "")
{
$end_txt = "";
}
else
{
$end_txt = $vor_end;
}
}
else
{
$end_txt = $vor_end;
}
$contents2 = file_get_contents("book.txt");
$contents3 = $end_txt . $contents2;
$file = fopen("book.txt","r+");
fputs($file,$contents3);
fclose($file);
$contents = file_get_contents("book.txt");
echo($contents); // Alle einträge ausgeben!
?>
Woran liegt das? Ich hab es Schon einmal mit einer If-Schleife probiert...
MFG
chakka1992
PS: Learning By Doing