| | | | |
| | |
| Gast
Beiträge: n/a
| Hallo, mit Hilfe von diesem Tutorial habe ich ein Gästebuch erstellt. Allerdings ist bei diesem Tutorial keine Sende-Button dabei, und ich, als PHP Anfänger, habe keine Ahnung wie das nun gehen soll. Ich habe den HTML Code des Eintragen Teils außerdem weitgehend verändert. Am PHP-Code habe ich nicht viel verändert, ich habe einiges herumprobiert und weil nichts half habe ich alles wieder so gemacht, wie es war (bzw. im Tutorial steht). Hier ist der Eintrag-Teil des Gästebuchs, und hier der show-Teil. (Ob die Ausgabe funktioniert weiß ich nocht nicht, konnte ja noch nicht testen). Also, was ich brauche ist ein funktionierender Sende (& reset) Button. index.php Code: <html>
<head>
<title>Gästebuch</title>
<link href="styles.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<h1>Gästebuch</h1>
<table width="400" border="1" align="center" cellpadding="2" cellspacing="0">
<tr>
<th align="left" valign="middle" scope="col">Eintragen | (c) by Toulouse</th>
</tr>
<tr>
<th align="left" valign="middle" scope="col"><u>bisherige Einträge</u>:
<?php
include ( "gaestebuch.txt" );
?>
</th>
</tr>
</table>
</body>
</html>
Code: <html>
<head>
<title>Eintragen</title>
<link href="styles.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<?php
if ( $action == "add" ) {
if ( $name == "" || $text == "" ) {
echo "Du hast nicht alle Felder ausgefüllt !
";
echo "Klicke auf den Backbutton deines Browsers";
}
else {
if ( $www == "" ) {
$eintrag = "<a href=\"mailto:$mail\">$name</a>
$text";
}
else{
$eintrag = "<a href=\"mailto:$mail\">$name</a>
<a href=\"$www\">$www</a>$text<hr>
";
}
$datei = fopen ( "gaestebuch.txt","w+" );
fwrite ( $datei, $eintrag );
fclose ( $datei );
echo "Danke $name für deinen Eintrag";
}
}
else {
?>
<h1>Ins Gästebuch eintragen</h1>
<table width="400" border="1" align="center" cellpadding="1" cellspacing="0">
<tr>
<th width="60" height="10" align="left" valign="middle" scope="col">Name:</th>
<th width="300" height="10" align="left" valign="top" scope="col"><form id="form1" name="name" method="post">
<label>
<input name="name" type="text" />
</label>
</form>
</th>
</tr>
<tr>
<th width="60" height="10" align="left" valign="middle" scope="row">Email:</th>
<th width="300" height="10" align="left" valign="top" scope="row"><form id="form2" name="mail" method="post">
<label>
<input type="text" name="mail" />
</label>
</form>
</th>
</tr>
<tr>
<th width="60" height="10" align="left" valign="middle" scope="row">Homepage:</th>
<th width="300" height="10" align="left" valign="top" scope="row"><form id="form3" name="www" method="post">
<label>
<input name="www" type="text" />
</label>
</form>
</th>
</tr>
<tr>
<th width="60" height="160" align="left" valign="top" scope="row">Nachricht:</th>
<th width="300" height="160" align="left" valign="top" scope="row"><form id="form4" name="text" method="post">
<label>
<textarea name="text" cols="40" rows="10"></textarea>
</label>
</form>
</th>
</tr>
<tr>
<th width="60" height="12" align="left" valign="middle" scope="row"></th>
<th width="300" height="12" align="left" valign="top" scope="row"><form id="form5" name="form5" method="post">
<label>
<input name="submit" type="submit" id="submit" value="Senden" />
</label>
<label>
<input name="back" type="reset" id="back" value="Zurücksetzen" />
</label>
</form>
</th>
</tr>
</table>
<form action="eintragen.php?action=add" method="get">
<?php
}
?>
</body>
</html>
Achja, die Funktion des Code: <?php
if ( $action == "add" ) {
Code: <?php } ?> Danke im voraus! |
| | |
| PHP Code Flüsterer Registriert seit: 21.08.2005 Beiträge: 4682 PHP-Kenntnisse: Fortgeschritten | |
| | |
| Erfahrener Benutzer Registriert seit: 18.09.2003
Beiträge: 13.598
PHP-Kenntnisse: Fortgeschritten ![]() | Hilfe. Das verlinkte Tutorial läuft ja noch mit register_globals = on. Meine Fresse. Alternativen: |
| |
| Themen-Optionen | |
| Thema bewerten | |
|
|
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Snoopy Formulare absenden | helios | PHP-Fortgeschrittene | 17 | 26.12.2008 12:55 |
| [input]-Feld per ENTER absenden | bp158 | HTML, Usability und Barrierefreiheit | 8 | 15.10.2007 13:46 |
| [input]-Feld per ENTER absenden | bp158 | HTML, Usability und Barrierefreiheit | 2 | 14.10.2007 14:36 |
| Nach Absenden eines Formulars Anzeige abrufen | R.E.M. | PHP Tipps 2006 | 9 | 18.09.2006 14:58 |
| Mehrfaches absenden durch Browserrefresh verhindern | HalliGalli | PHP Tipps 2006 | 11 | 16.05.2006 15:01 |
| [Erledigt] formular aus anderem Frame absenden | HTML, Usability und Barrierefreiheit | 3 | 26.01.2006 15:37 | |
| php-formular problem beim absenden | PHP Tipps 2005-2 | 7 | 01.10.2005 23:44 | |
| nachricht auf homepage | PHP Tipps 2005 | 7 | 21.04.2005 09:28 | |
| Mehrfachtes absenden eines Formulars verhindern ? | PHP Tipps 2005 | 12 | 16.03.2005 01:13 | |
| [Erledigt] NAchricht während Verarbeitung | PHP Tipps 2004-2 | 4 | 13.11.2004 22:51 | |
| mail absenden | PHP Tipps 2004-2 | 5 | 13.11.2004 17:13 | |
| Formular: Vorschau und Absenden in einem | PHP Tipps 2004 | 3 | 04.11.2004 09:19 | |
| Kontaktformular - Nachricht wurde verschickt | PHP Tipps 2004 | 4 | 22.10.2004 09:18 | |
| nachricht als gelesen makieren ? | PHP Tipps 2004 | 7 | 12.07.2004 18:38 | |
| Button OnMouseOver --> Nachricht in Textfeld anzeigen las | HTML, Usability und Barrierefreiheit | 7 | 16.06.2004 17:49 | |
| Besucher kamen über folgende Suchanfragen bei Google auf diese Seite |
| gästebuch nachricht, was ist ein postlabel?, html funktionierender abschicken button, html code gästebuch sende button, nachricht absenden html, ich habe einen html code für ein gästebuch, nachricht absenden |

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.