5

Possible Duplicate:
maximum length of HTTP GET request?

how many characters can be sent using get in url in php.

means what is the limitation to send data using GET method in php

I am trying to send the dat like the following. But in the next page i am not getting all the data.

xmlhttp2.open("GET","http://localhost/My_Project/LeaveLength_Ajax.php?_Get_FromDate="+FromDate_G+"&_Get_ToDate="+ToDate_G+"&PLAvailabe_JS="+PLAvailabe_JS +"&CLAvailabe_JS="+CLAvailabe_JS +"&LWPAvailabe_JS="+LWPAvailabe_JS+"&MLAvailabe_JS ="+MLAvailabe_JS +"&COMPAvailabe_JS="+COMPAvailabe_JS+"&FromHomeAvailabe_JS="+FromHomeAvailabe_JS +"&LeaveType_JS="+LeaveType_JS,true);

Please help me to sort this problem.

Community
  • 1
  • 1
Gnan
  • 63
  • 1
  • 8
  • What's the total size of that? Have you tried setting it to a string, displaying (`alert`) it, and making sure the URL is valid? And so on. And yes, even if all that works, there could be limits on the maximum size. – Matthew Jun 13 '11 at 03:07

3 Answers3

4

The browser, server, and/or PHP could in theory all limit the size. For instance, see: http://support.microsoft.com/kb/208427.

RFC 2068 (perhaps outdated):

Note: Servers should be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations may not properly support these lengths.

You should switch to using a POST request and send them as post fields as opposed to query parameters.

Matthew
  • 47,584
  • 11
  • 86
  • 98
0

I heard 256 is the maximum length of a request uri. If you want to stay cross server and cross browser.

SBSTP
  • 3,479
  • 6
  • 30
  • 41
0

Basically, it depends on your browser. As far as I understand, you are using JavaScript to make the request, therefore this is not a PHP question.

Assuming that your question is related to Javascript, it completely depends on your browser about what length of request URI does it support. Some browsers have 256 bytes, some have 4 kb, some have 32 kb in terms of length.

However, your URI does not seem that long, therefore I think there's something wrong with your exact request URI that prevents rest of URI to be requested. That may be a # character, an unescaped unicode character or something else.

Can you find and tell us what is exact URI that your browser requests (using a tool like Firebug on Firefox, or built-in tool on Chrome) and what is the URL that you get from PHP. (can be printed using var_dump($_GET);.

ahmet alp balkan
  • 42,679
  • 38
  • 138
  • 214