Still needs to be fixed up some more,  but it's a start.

Trying to make $category_id more secure. I assume $category_id is only
taking numbers, if we're taking pretty links as the id, then my approach
won't work.