1

What is maximum post and get variable limit? I am calling a page in ajax and it goes on fail function

 $.ajax("data_valid.php?duplicateaccountname=a")
        .done(function(data) {
            alert(data+"data");
         })
        .fail(function() { 
            alert("error");
            dup = "error";
 });

but this is working

            $.ajax("data_valid.php?dup=a")
        .done(function(data) {
            alert(data+"data");
         })
        .fail(function() { 
            alert("error");
            dup = "error";
         });

is there is any variable name limit?

Mandeep Singh
  • 2,016
  • 7
  • 19
  • 32
  • [Check this out](http://stackoverflow.com/a/2659995/1207346) – Dale Jun 14 '13 at 11:31
  • 1
    This should not at all be a problem. GET parameters are often that long. Is it a server error you get? Or a PHP error? You can inspect that using e.g. Chrome Inspector or Firebug... – Willem Mulder Jun 14 '13 at 11:37
  • possible duplicate of [maximum length of HTTP GET request?](http://stackoverflow.com/questions/2659952/maximum-length-of-http-get-request) – Robert Jun 14 '13 at 11:37

2 Answers2

4

<?php phpinfo(); ?>

in your php.ini, there's a variable like post_max_size, max_get_size

you might be using the suhosin patch which has its own max query string/post/get/..... variables in its config.

php.ini:

post_max_size = 8M #8Mb is 8000000 bytes, 1 byte = 1 ascii character

suhosin.ini:

;suhosin.get.max_array_depth = 50
;suhosin.get.max_array_index_length = 64
;suhosin.get.max_name_length = 64
;suhosin.get.max_totalname_length = 256
;suhosin.get.max_value_length = 128000
;suhosin.get.max_vars = 100
;suhosin.post.max_array_depth = 100
;suhosin.post.max_array_index_length = 64
;suhosin.post.max_name_length = 64
;suhosin.post.max_totalname_length = 256
;suhosin.post.max_value_length = 1000000
;suhosin.post.max_vars = 1000
;suhosin.request.max_array_depth = 100
;suhosin.request.max_array_index_length = 64
;suhosin.request.max_totalname_length = 256
;suhosin.request.max_value_length = 1000000
;suhosin.request.max_vars = 1000
;suhosin.request.max_varname_length = 64
;suhosin.upload.max_uploads = 25
;suhosin.session.max_id_length = 128
Daniel W.
  • 31,164
  • 13
  • 93
  • 151
-1

Answered here: What is the size limit of a post request?

And here: maximum length of HTTP GET request?

Community
  • 1
  • 1
  • 2
    The poster is talking about max length of a variablename (e.g. duplicateaccountname in the URL), not about the size of the complete POST or GET requests... – Willem Mulder Jun 14 '13 at 11:38