Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question

marked as duplicate by Wesley Murch, John Saunders, Bill the Lizard Jun 13 '11 at 3:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
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 3:07
add comment

3 Answers

up vote 2 down vote accepted

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

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);.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.