Ictuser Ai
Ictuser Ai

Reputation: 41

AJAX 403 forbidden when making ajax request

The website initiates ajax request but always get return 403 error for all browsers.

I tested it by initiating the same call in firebug console, it works (status: 200)

What is the problem can be deduced?

jQuery.ajax({ 
    url: "cart_ajax_get_product.php", 
    data: {id: 355, qty: 1}, 
    success: function(data) { }); }, 
    error: function(err) { } 
});

Thanks

Upvotes: 4

Views: 9599

Answers (2)

Pankti Shah
Pankti Shah

Reputation: 35

jQuery.ajax({ 
url: "cart_ajax_get_product.php", 
data: {id: 355, qty: 1}, 
success: function(data) {

}
error: function(err) { } 
});

Upvotes: 0

james
james

Reputation: 26271

Might be an issue related to apache mod_security. Try forcing the ajax request to GET instead of POST:

jQuery.ajax({ 
    type:"GET",
    url: "cart_ajax_get_product.php", 
    data: {id: 355, qty: 1}, 
    success: function(data) { }); }, 
    error: function(err) { } 
});

Or if that doesn't help...

You could try setting these options on the server's .htaccess, or configuring them elsewhere:

SecFilterScanPOST Off
SecFilterEngine Off

Upvotes: 1

Related Questions