Hi all,
What i want to do is pass the correct value from the hidden field so that add_new_cat2.php can be executed. At the moment the value passed always equals "0".
How do i get the value to correspond with the CatID?
I hope this makes sense, if not feel free to ask me questions in the hope that i can better explain it.
<?
$link = mysql_connect('localhost', '', '');
mysql_select_db('melb');
$query = "SELECT * FROM categories WHERE CatParent = $id";
$result = mysql_query($query);
if(mysql_num_rows($result) == 0){
echo "<font face=Verdana, Arial size=2>There are <b>no</b> sub-categories</font>";
} else {
while ($row = mysql_fetch_array($result)) {
echo "<font face=Verdana, Arial size=2><b>{$row['CatName']} - </b></font><a href=\"melb_edit_cat1.php?id={$row['CatID']}\"><font color=\"red\" face=\"Verdana\" size=2><b>Edit</b></font></a><br>\n";
}
}
?>
<br><br><font face=Verdana, Arial size=2><b>Add new sub-category:</b><br></font>
<hr>
<form method=post action="add_new_cat2.php">
<font face=Verdana, Arial size=2 color=red><b>Sub-Category Name:</b></font><br>
<input type=text name=CatName maxlength=30 size=25><br><br><br>
<input type=submit value="SUBMIT">
<input type="hidden" name="CatID" value="$id">
</form>
<?
}
else
{
echo "You are not logged in.</p>";
echo "Only logged in members may see this page.</p>";
}
echo "<a href=\"melb_members.php\">Back to main page</a>";
?>