duanhan9479 2013-04-17 06:22
浏览 8
已采纳

获得$ _POST []值后,AJAX调用返回

My problem is this. I have this ajax call:

   $.ajax({
                url: "./changepassword_ajax.php",
                type: "POST",
                data: formData,
                processData: false,
                contentType: false,
                success: function (res) {

                }
        });

The var formData has info (that's not the problem). In "changepassword_ajax.php" I have this code:

$obj = new All();
$clave  = $obj->CNF_get('admin_clave');

if($_POST('oldpassword') == $clave){
    $obj->CNF_set('admin_clave', $_POST('newpassword'));
    echo "OK";
}else{

    echo "ERROR";
}

After doing this:

if($_POST('oldpassword') == $clave){

The ajax call returns. So it's not reaching the rest of the code.

Thanks for your help.

  • 写回答

3条回答 默认 最新

  • dplase3140 2013-04-17 06:32
    关注

    I think you did a small mistake while writing a code replace line if($_POST('oldpassword') == $clave){ with if($_POST['oldpassword'] == $clave){

    and re-run the code

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作