Ich habe ein großes Problem. Ich mir eine Art Gästebuch gebastelt und jetzt schreibt die datei Änderungen nicht in die Datenbank. Hier sind mal die Codes:
index_gb.php PHP-Code:
<?php
echo "<div align='center'><h1>Gästebuch</h1></div>";
echo "<form action='gb_start.php'>";
$connection=mysql_connect("localhost","root","*****");
$gb_auslesen="select * from gast";
$ergebnis=mysql_db_query("db_gb",$gb_auslesen,$connection);
while(list($name,$hp,$email,$icq,$msg)=mysql_fetch_array($ergebnis))
{
echo "<table width='40%' border='1' align='center' bgcolor='#EEEEEE'>
<tr>
<td>
<table width='100%' border='0' bgcolor='#CCCCCC'>
<tr>
<th>
<div align='left'>Name: ".$name."</div>
</th>
<td width='50'>
<div align='right'>";
if($email != "") echo "[email='".$email."'][img]bilder/email.gif[/img][/email] ";
if($hp != "") echo "[url='http://".$hp."'][img]bilder/home.gif[/img][/url]";
echo " </div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>".$msg."</td>
</tr>
</table>
";
}
mysql_close($connection);
echo "<div align='center'><input type='submit' value='Eintrag erstellen'></input></div>";
?>
gb_start.php PHP-Code:
<?php
echo "<form action='gb_ende.php' method='POST'>";
echo "<table width='40%' align='center' bgcolor='#CCCCCC'>
<tr>
<td align='center'>[b]Gästebucheintrag erstellen[b]</td>
</tr>
</table>
";
echo "<table width='40%' align='center' bgcolor='#EEEEEE'>
<tr>
<td>Name: </td>
<td><input typ='text' name='name' size='25' maxlength='50'></input></td>
</tr>
<tr>
<td>Homepage: </td>
<td><input typ='text' name='hp' size='25' maxlength='50'> (ohne http:// )</input></td>
</tr>
<tr>
<td>e-mail: </td>
<td><input typ='text' name='email' size='25' maxlength='50'></input></td>
</tr>
<tr>
<td>Icq: </td>
<td><input typ='text' name='icq' size='25' maxlength='9'></input></td>
</tr>
<tr>
<td>Nachricht: </td>
<td><textarea name='msg' cols='25' rows='7'></textarea></td>
</tr>
</table>
<div align='center'><input type='submit' value='Absenden'> </input>
<input type='reset' value='Löschen'></input></div>";
?>
ende_gb.php PHP-Code:
<?php
echo "<form action='index_gb.php'>";
$name=$_POST[name];
$hp=$_POST[hp];
$email=$_POST[email];
$icq=$_POST[icq];
$msg=$_POST[msg];
$connection=mysql_connect("localhost", "root", "*****");
$sqlbefehl="insert into gast values ($name, $hp, $email, $icq, $msg)";
mysql_db_query("db_gb", $sqlbefehl, $connection);
mysql_close($connection);
echo "<table width='40%' border='1' align='center' bgcolor='#EEEEEE'>
<tr>
<td>
<table width='100%' border='0' bgcolor='#CCCCCC'>
<tr>
<th>
<div align='left'>Name: ".$name."</div>
</th>
<td width='50'>
<div align='right'>";
if($email != "") echo "[email='".$email."'][img]bilder/email.gif[/img][/email] ";
if($hp != "") echo "[url='http://".$hp."'][img]bilder/home.gif[/img][/url]";
echo " </div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>".$msg."</td>
</tr>
</table>
";
echo "<div align='center'><input type='submit' value='Zurück zum Gästebuch'></input></div>";
?>
Ich weis leider nicht wo der fehler liegt, da ich auch keine Fehlermeldung bekomme.
Vielleicht kann mir jemand helfen.
