Is there a limit on the length of the $ _ GET method in PHP?

Source: Internet
Author: User
Today, I am reading the $ _ GET function in W3C, which is limited to less than 100 characters, and some people can also see that it is less than 2 kb, in addition, we can see that the $ _ GET method has no length limit, because the amount of data that can be submitted is related to the URL length, and the URL has no length limit. Can you tell me whether this method exists... today at W3C $_GETFunction, which is limited Up to 100 charactersAnd some people also see that Less than 2 kbIn addition, we can see that the $ _ GET Method No length limitBecause the amount of data that can be submitted is related to the URL length, and the URL has no length limit.

Is there a limit on the length of this method? What is there?

Reply content:

Today at W3C$_GETFunction, which is limitedUp to 100 charactersAnd some people also see thatLess than 2 kbIn addition, we can see that the $ _ GET MethodNo length limitBecause the amount of data that can be submitted is related to the URL length, and the URL has no length limit.

Is there a limit on the length of this method? What is there?

The HTTP protocol never specifies the length limit of GET/POST requests. The length limit mainly depends on the decision and settings of the browser and the web server. The settings of various browsers and web servers are different.
Generally, the default webserver limit is 8 KB, but you can modify the configuration.
The maximum values of MSIE and Safari on the browser side are 2 kb, 4 kb for Opera, and 8 KB for Firefox. From the perspective of cross-browser applications, you should select the minimum 2KB.

In my impression, a long time ago, the url length was generally limited to 1024 bytes. Different browsers had little difference and I don't know the current situation.

InhttpIn the protocolurlThe maximum length of a url is usually related to the user's browser. The acceptable maximum length of a browser is often different.

IE browser:2083Characters
Firefox:65,536Characters
Safari:80,000Characters
Opera:190,000Characters
Google:8182Characters

In addition, different web servers can accept different url lengths.

I recently encountered this problem raised by the landlord. The scenario is to use the GET method to submit a form while saving some information. Then, an error is reported, indicating that the server request limit is exceeded, the reason is that too much information is saved, and the GET method will display all the data on the URL. After the method is changed to POST, the problem does not exist. Baidu once said that the URL length is restricted by the browser, and different browsers have different length restrictions.

Sqrtqiezi is right.
Whether it is post or get, there must be a length limit, which is determined by the minimum value set between the server and the browser.
Get is generally the largest in 2 K

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.