Unable to pass variables than contain large blocks of text through ajax.get()
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.
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?
This is a limitation of GET requests. In this case you might have to do a POST.
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?)
精彩评论