Undefined index: Error in ajax POST and/or php script?

前端 未结 4 1239
清歌不尽
清歌不尽 2021-01-13 22:12

I\'m trying to send an ajax POST to a php file, however the php file sends a notice of \"undefined index\", and the php file never seems to receive the value i\'m trying to

4条回答
  •  清歌不尽
    2021-01-13 22:30

    Change Ajax syntax...

    $.ajax({
        type: "POST",
        url: 'deleteMediaFromDatabase.php',
        data: {'vals' : val},//Have u tried this
        success: function(output) {
            alert(output);
        }
        error: function(request, status, error){
                alert("Error: Could not delete");
        }
    );
    

提交回复
热议问题