0

I have a Controller which consumes Ajax requests and responds with the result of the database operation. The Ajax call is formed with a set of IDs (an array of ints) and a message.

When the set of IDs have a normal ammount of IDs (I tested with 20 IDs), the Ajax call returns normally. When trying to send 3000 IDs, I get an almost instant response with a 403 Forbidden Access error.

This is probably a Codeigniter or Apache server error. I looked for it, but didn't find any answer.

Thanks in advance.

Minoru
  • 1,680
  • 3
  • 20
  • 44

2 Answers2

0

On your AJAX code, are you sending it via GET?, if so, change it to POST

$.ajax({
        type: "POST",
        url: 'url',
        data: data,
        dataType: "json",
        cache: false,
        contentType: false,
        processData: false,
        success: function (data) {
            //some code
        }
    });
0

By default php.ini has 1000 max_input_vars variable.

Here you have the docs how to change

Change that and you will fix the issue. I had the same problem before.

Ex: placing following lines into .htaccess

php_value max_input_vars 3000
php_value suhosin.get.max_vars 3000
php_value suhosin.post.max_vars 3000
php_value suhosin.request.max_vars 3000
Community
  • 1
  • 1
Florin
  • 5,781
  • 2
  • 20
  • 30