douzhicong5965 2014-12-14 17:36
浏览 17

发布php javascript AJAX时的编码问题

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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
    • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数