When the user submits the form (after selecting the first category), just do a query that would look something like:
// Run the query
$sql = "SELECT subcategory_id, subcategory_name FROM table WHERE category_id = " . $HTTP_POST_VARS['category_id'] . "";
// Get the result
$result = mysql_query($sql);
// Loop through the rows
while ($row = mysql_fetch_row($result))
{
echo "Sub Category " . $row['subcategory_id'] . " = " . $row['subcategory_name'] . "<br />";
}
I obviously have no clue what your specific tables and fields are, but you can just replace as needed.