<?
if ($_POST['edit'] && $_POST['act'] == "edit") {
$data_array = array($_POST['author'], $_POST['comment'], $_POST['date']);
$gb->updateRecord($_POST['id'], $data_array);
}
elseif ($_GET['id']) {
$record = $gb->getToEdit($_GET['id']);
?>
<b>Edit record:</b> (id = <?=$record['id'] ?>)
<form method="post" action="<?=$PHP_SELF . '?act=edit' ?>">
<input type="hidden" name="act" value="edit">
<input type="hidden" name="id" value="<?=$record['id']?>">
<input type="hidden" name="date" value="<?=$record['date']?>">
Name:<br>
<input type="text" name="author" size="25" value="<?=$record['author'] ?>"><br>
Comment:<br>
<textarea name="comment" cols="25" rows="6"><?=$record['comment'] ?></textarea><br>
<input type="submit" name="edit" value="Edit">
</form>
<hr size="1" color="#FF0000">
<?
}
?>