mysql_connect($db_host, $db_user, $db_pass) OR die("Fehler beim Zugriff auf die Datenbank.");
mysql_select_db($db_name);
$sql = "SELECT id, name, email, homepage, date, comment FROM guestbook WHERE id=$nummer";
$res = mysql_query($sql);
while ($line = mysql_fetch_object($res))
{ echo'
<form method="post" action = "operate.php?action=gb_edit&id='.$line->id.'" target="_blank">
<table border="0" width="100%" cellspacing="4" cellpadding="0" height="421">
<tr>
<td width="11%" height="25">Name:</td>
<td width="89%" height="25"><input type="text" name="name" size="29" value="'.$line->name.'"></td>
</tr>
<tr>
<td width="11%" height="21">Datum:</td>
<td width="89%" height="21">'.date("d.m.Y", $line->date).'</td>
</tr>
<tr>
<td width="11%" height="25">Email:</td>
<td width="89%" height="25"><input type="text" name="mail" size="29" value"'.$line->email.'"></td>
</tr>
<tr>
<td width="11%" height="25">Homepage:</td>
<td width="89%" height="25"><input type="text" name="page" size="29" value ="'.$line->homepage.'"></td>
</tr>
<tr>
<td width="11%" valign="top" height="252">Kommentar:</td>
<td width="89%" height="252" ><textarea rows="12" name="comment" cols="60">'.$line->comment.'</textarea></td>
</tr>
<tr>
<td width="11%" valign="top" height="49"></td>
<td width="89%" height="49" ><input type="submit" value="Bearbeiten" name="submit">
<input type="reset" value="Nicht Bearbeiten" name="reset"></td>
</tr>
</table>
</form>';} exit();}
if($action == "gb_edit")
{
$id = $_GET['id'];
$name = $_POST['name'];
$email = $_POST['mail'];
$hompage = $_POST['page'];
$comment = $_POST['comment'];
/*mysql_connect($db_host, $db_user, $db_pass) OR die("Fehler beim Zugriff auf die
Datenbank.");
mysql_select_db($db_name);*/
echo "ID:$id,<br>Name:$name, <br>E-Mail:$email,<br> Hpage:$homepage, <br> Kommentar:
$comment";
/*$sql = "UPDATE guestbook SET name = '$name', email = '$email', homepage =
'$hompage', comment = '$comment'
WHERE id = '$id'";
mysql_query($sql);
echo '
<table border="0" width="100%">
<tr>
<td width="12%" vALIGN=TOP><img src="img/sucess.gif" width="33"
height="99"></td>
<td width="88%">GB Eintrag bearbeitet.</td>
</tr>
</table>';
exit();*/
}