Why doesn't this work. The text isn't displayed in the text boxes for editing?
<!-- editauthor.php -->
<HEAD>
<TITLE> Edit category </TITLE>
</HEAD>
<BODY>
<?php
include("articles.inc");
mysql_select_db("petesmc_articles");
if ($submit): // The category's details have
// been updated.
$sql = "UPDATE category SET Cat='$cat', Description='$description' WHERE ID=$id";
if (mysql_query($sql)) {
echo("<P>category details updated.</P>");
} else {
echo("<P>Error updating category details: " .
mysql_error() . "</P>");
}
?>
<P><A HREF="cat.php">Return to category list</A></P>
<?php
else: // Allow the user to edit the category
// with ID=$id
$collect = mysql_query("SELECT Cat, Description FROM category WHERE ID=$id");
if (!$collect) {
echo("<P>Error fetching category details: " .
mysql_error() . "</P>");
exit();
}
$collect = mysql_fetch_array($collect);
$cat = $category["Cat"];
$description = $category["Description"];
?>
<FORM ACTION="<?php echo($PHP_SELF); ?>" METHOD=POST>
<P>Edit the author:<BR>
Category: <INPUT TYPE=TEXT NAME="cat" VALUE="<?php echo($cat); ?>" SIZE=20 MAXLENGTH=100><BR>
Description: <textarea name="description" ROWS=15 COLS=45 WRAP><?php echo($description); ?></textarea>
<INPUT TYPE=hidden NAME="id" VALUE="<?php echo($id); ?>">
<INPUT TYPE=SUBMIT NAME="submit" VALUE="SUBMIT"></P>
</FORM>
<?php endif; ?>
</BODY>