G
G
Gera112020-09-10 16:26:14
PHP
Gera11, 2020-09-10 16:26:14

302 error after ajax request. How to fix?

Actually, the request itself:

function delCompares() {
    ShowLoading("");
    $.get(dle_root + "engine/ajax/compare.php", { compare_id: '1', action:'delete', skin:dle_skin}, function(b) {
        HideLoading("");
        if ( b != 'ok' ) {
          DLEalert(b, dle_info);
        } else {
          alert('Ошибка');
        }
    });
    return false;
}


And the php handler:
} elseif( $_REQUEST['action'] == "delete" ) {
    $db->query( "UPDATE " . USERPREFIX . "_users SET compare='' WHERE user_id = '{$member_id['user_id']}'" );
    $buffer = "ok";
} else {
    die( "error" );
}


The response is a 302 error. Why and how to fix I have no idea what could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question