| | | | |
| | |
| PHP Code Flüsterer Registriert seit: 21.08.2005 Beiträge: 4682 PHP-Kenntnisse: Fortgeschritten | |
| | |
| Gast
Beiträge: n/a
| komm doch noch nicht zurecht <?php // Speichert einen neuen Eintrag in der Datenabank ab if ($action=="save") { $datum = time(); $zeit = date("H:i:s"); $inhalt = $inhalt; $name = ($name) ? $name : "unbekannt"; mysql_query("insert into $table (name,email,open,hp,inhalt,datum,zeit) VALUES ('$name','$email','$open','$hp','$inhalt','$datum' ,'$zeit')"); $betreff = "Es wurde ein Gdstebucheintrag vorgenommen!"; $empfaenger = "mail@web.de"; $betreffgast = "Ihr Gdstebucheintrag"; $danke = "Vielen Dank f|r Ihren Eintrag in meinem Gdstebuch. "; mail($empfaenger, $betreff, $inhalt, "From: test.de <webmaster@blackmirror.de>"); mail($email, $betreffgast, $danke, "From: test.de <webmaster@test.de>"); } // Hier beginnt die HTML Ausgabe if($action=="neu") ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>?show=guestbook" method=post> <input type="hidden" name="action" value="save"> <table> <tr> <td>Name:</td> <td><input type=text name=name></td> </tr><tr> <td>Email:</td> <td><input type=TEXT name=email></td> </tr><tr> <td> </td> <td><input type=checkbox name=open checked value=1><font size=1>Soll die Emailadresse spdter im Gdstebuch angezeigt werden?</font></td> </tr><tr> <td>Seite:</td> <td><input type=text name=hp value=http://></td> </tr><tr> <td>Text:</td> <td><textarea name="inhalt" rows="6" cols="25"></textarea></td> </tr><tr> <td> </td> <td><input type=submit class="button" value="In4s Gdstebuch eintragen"></td> </tr></table></form> </div> <div style= width:290> <table> <tr> <td> <?php if($lim == "") { $lim = 0; } $limi = bcadd($lim, 5); $backlim = bcsub($lim, 5); $server = "localhost"; $user = "test"; $passwort = "test"; $datenbank = "test"; $tabelle = "gast"; MYSQL_CONNECT($server, $user, $passwort) or die ( "<H3>Datenbankserver nicht erreichbar</H3>"); MYSQL_SELECT_DB($datenbank) or die ( "<H3>Datenbank nicht vorhanden</H3>"); $alles = mysql_query(" select * from $tabelle "); $zaehlen = mysql_num_rows($alles); $result=MYSQL_QUERY( "SELECT * FROM $tabelle ORDER by datum desc limit $lim,5"); if($zaehlen <1) { echo "Da hat wohl niemand etwas eingegeben! SORRY!!!"; } else { while($row = mysql_fetch_object($result)) { $nr = $row->nr; $name = $row->name; $open = $row->open; $email = $row->email; $hp = $row->hp; $inhalt = $row->inhalt; $kommentar = $row->kommentar; $datum = date("d.m.y",$row->datum); $zeit = $row->zeit; echo "Eintrag " .$nr; echo " vom " .$datum; echo " um " .$zeit. " Uhr"; echo " "; echo "Name: " .htmlspecialchars($name); echo " "; echo "Emailadresse: " .$email; echo " "; echo "Homepage: $hp "; echo " "; echo "Text: " .htmlspecialchars($inhalt); echo "<hr>"; |
| Themen-Optionen | |
| Thema bewerten | |
|
|
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [Erledigt] Galerie Problem... | coraplanet | PHP Tipps 2008 | 4 | 06.06.2008 13:42 |
| Problem mit Post ? | PHP Tipps 2007 | 8 | 28.12.2005 12:01 | |
| Post zum Host nach discconect... | PHP-Fortgeschrittene | 4 | 01.12.2005 17:47 | |
| xampp->apache problem mit skydsl proxy | djrace | Server, Hosting und Workstations | 0 | 25.09.2005 16:14 |
| post problem | PHP Tipps 2005-2 | 21 | 08.09.2005 21:44 | |
| MySQL, PHP und ein großes Problem! | Datenbanken | 2 | 27.08.2005 10:51 | |
| wiedermal ein kleines problem mit der post methode | Tic Rederon | PHP Tipps 2005-2 | 4 | 23.08.2005 08:59 |
| [Erledigt] PHP Problem (GET und POST variabeln) | PHP-Fortgeschrittene | 1 | 16.08.2005 17:39 | |
| [Erledigt] Problem mit Backslash | Patrick Schwarz | PHP Tipps 2005-2 | 5 | 26.07.2005 09:54 |
| POST Problem: Übergabe von Formulardaten | Asipak | PHP Tipps 2005-2 | 19 | 19.07.2005 11:12 |
| [Erledigt] Problem mit User/Group: nobody(99)/99 | Server, Hosting und Workstations | 3 | 09.07.2005 15:31 | |
| [Erledigt] Problem: The requested method POST is not allowed for the | Server, Hosting und Workstations | 17 | 31.05.2005 15:15 | |
| Problem mit POST | PHP Tipps 2005 | 21 | 24.05.2005 16:12 | |
| Problem mit post und get? | PHP Tipps 2004 | 2 | 21.08.2004 14:39 | |
| Problem mit alter JavaScript-Funktion | woods | PHP Tipps 2004 | 1 | 13.08.2004 13:34 |
| Besucher kamen über folgende Suchanfragen bei Google auf diese Seite |
| probleme mail 4.3 mit web.de |

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.