2

When I try to pass a big number of variables through ajax.get() and some of them containt very long text (~1000 characters) PHP doesn't seem to receive any of them. On the other hand, when the variables contain much less text everything seems to be working fine.

This is the code:

$.ajax({
    type: "GET",
    url: "../rate_insert.php",
    async: true,
    data: ({
    "ftiaxto_save_input": ftiaxto_save_input,
    "lektion_buch": lektion_buch,
    .
    . // lots of variables
    .
    "lektion_photo": lektion_photo,
    "lektion_photo_thessi": lektion_photo_thessi
}),

success: function(data) {
    alert("Data Loaded: " + data);
} // data

}); // .get

Var_dump($_GET) in rate_insert.php does not return anything. My php.ini settings are as follows:

post_max_size = 80M
max_input_time -1
memory_limit = 128M

Note: there is no httpd server and php runs as CLI SAPI.

3 Answers3

5

There is a limit to how much data you can pass through GET. You should use POST instead.

EDIT - look here for limitations What is the maximum length of a URL in different browsers?

Community
  • 1
  • 1
Nicola Peluchetti
  • 76,206
  • 31
  • 145
  • 192
2

This is a limitation of GET requests. In this case you might have to do a POST.

ek_ny
  • 10,153
  • 6
  • 47
  • 60
0

Some more info about the limitations of GET requests: http://www.boutell.com/newfaq/misc/urllength.html (thanks to Vinko Vrsalovic @ Is there a limit to the length of a GET request?)

Community
  • 1
  • 1
Björn
  • 2,638
  • 16
  • 18