Hi.
My form
<form action="saveProfile.php" method="post" name="ProfileUpdate" id="ProfileUpdate" >
<input name="Smeknamn" id="Smeknamn" type="text" value="<?php echo $v["user_name"]; ?>" maxlength="16" id="ctl00_ctl00_cphContent_cphContent_cphContentLeft_tbUsername" onkeydown="return ((event.keyCode != 16) || (event.keyCode == 16 && this.value.length >= 1));" style="width: 130px;" />
</form>
When I try to echo $_POST["Smeknamn"];
on saveProfile.php i get ���
on the characters Ö Ä Å
Why is this happening? saveProfile
AND editProfile
is encoded in UTF-8 without BOM, and meta utf8 and all that.
UPDATE UPDATE
$smeknamn = $data["Smeknamn"]
Sorry forgot to mention that i had this foreach. And its $smeknamn im echoing and getting Ã�Ã�Ã�. I just tried $_POST["Smeknamn"] and it echo out ÖÄÅ just fine.. So the problem is now in the foreach() that makes the öäå chars Ã�Ã�Ã�. How can i fix this?
foreach($_POST as $key => $value) {
$data[$key] = filter($value);
}
function filter($data) {
$data = trim(htmlentities(strip_tags($data)));
if (get_magic_quotes_gpc())
$data = stripslashes($data);
$data = mysql_real_escape_string($data);
return $data;
}