从AJAX获取数据调用空请求数组

时间:2015-10-06 17:29:32

标签: ajax post request

来自AJAX请求的我的数据似乎已到达(在JS中),但我在请求中得到了未定义的索引错误(在PHP中)。

JS:

$.ajax(
        { 
            url: "cidades.ajax.php",
            data: {estado : $(this).val()},
            type: "POST",
            async: false,
            cache: false,   
            contentType: 'application/json; charset=utf-8',
            success: function(response) {
                alert(response);
            }
        });

PHP:

$cod_estados =  $_REQUEST['estado'];

Inspector Request Pay loading正在设置为 检查员estado=3

我收到了以下回复。

<br />
<b>Notice</b>:  Undefined index: estado in <b>F:\projetos\bt\agentes\cidades.ajax.php</b> on line <b>11</b><br />
[]

我感谢任何帮助,谢谢......

0 个答案:

没有答案