0

I have an issue that bothers me for two days already. When I send datas with jQuery ajax, the php file encodes it wrong. Here is the ajax code:

function valideffective(ecole)
{
    'validationecole.php',
    {
        type: "validation",
        name: $(ecole).parent().children("td").eq(0).html(),
        city:$(ecole).parent().children("td").eq(1).html()
    },
    function(data)
    {
        $(ecole).parent().toggle(500);
    },
    'text'
);
}

PHP code:

$so = $request->Validation ( $_POST ["name"], $_POST ["city"] );
if ($so == 1) 
{
    echo "OK";
} 
else 
{
    echo $_POST ["name"];
}

When I echo what the php file gets, all the accent (é,à,è,...) are like é... I checked the headers, they are all utf-8.. I dont know how to fix this problem

Lee Taylor
  • 6,091
  • 14
  • 26
  • 43
Robin Delaporte
  • 565
  • 5
  • 14

0 Answers0