change:
//$_POST[$k] = htmlspecialchars($v, ENT_QUOTES);
to:
$_POST[$k] = htmlspecialchars($v, ENT_QUOTES);
right after i posted, i realized that line was commented and edited my original post, you must have been quick on ready my reply and got the code before i edited it.