add this line:
mysql_query("SET NAMES 'utf8'");
Like this
if(!(@mysql_connect("$host","$user","$pass") && @mysql_select_db("$tablename"))) {
?>
MSQL ERROR
exit;
}
else{
mysql_query("SET NAMES 'utf8'");
}
Also:
- Add meta charset to the form page
or HTML5