OAA gibi karakterler ile ilgili sorunlar

0 Cevap php

Benim formu

<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 &amp;&amp; this.value.length >= 1));" style="width: 130px;" />
</form>

Ben saveProfile.php üzerine echo $_POST["Smeknamn"]; çalıştığınızda i almak Ã�Ã�Ã� karakterleri Ö Ä Å

Bu neden oluyor? saveProfile VE editProfile BOM olmadan UTF-8 olarak kodlanmış ve meta utf8 ve tüm olmasıdır.

UPDATE Güncelleme

$ Smeknamn = $ veri ["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;
}

0 Cevap