"<input type='submit' class='posttitle' value='".$title."'>"
Say your post title was “You’re the Best”. If you put that
$title into your html above, you get this:
<input type='submit' class='posttitle' value='You're the Best'>
value is now “You”, there are three nonsense attributes (
Best), and then there’s an extra trailing quote. See the problem? How could you fix that?