Simplest fix is that extract($_POST) should be joined with extract($_GET) as $cat_id is never populated for these functions