Fixed posts.php controller, added foreach to check for tagname in tags table