Is there a length limit to the $_get method in PHP?

Source: Internet
Author: User
Today in the view of the $_GETfunction, which is written to limit the 100字符以内And then also have to see netizens say yes 2kb以下, and see another way of saying that is the $_get method 没有长度限制Because the amount of data that can be submitted is related to the length of the URL, and the URL is no length limit

Is there a length limit for this method? How many words are there?

Reply content:

Today in the $_GET Internet view function, which is written on the limit 100字符以内 , and then also see the Netizen said yes 2kb以下 , see also a statement is the $_get method 没有长度限制 , because its amount of data can be submitted with the URL length, and the URL is no length limit

Is there a length limit for this method? How many words are there?

The HTTP protocol never specifies what the get/post request length limit is. This length limit is primarily dependent on the browser and Web server's decision and settings, and the various browsers and Web server settings are different.
Usually the default limit for webserver is 8KB, but you can change it by modifying the configuration.
Browser side MSIE and Safari max value 2KB, Opera 4kb,firefox 8KB. From an application cross-browser perspective, you should choose a minimum of 2KB.

My impression, a long time ago, the length of the URL is generally 1024 bytes upper limit, different browsers are not big, do not know the situation now.

In the http agreement, in fact, there is no limit to the url length, often the maximum length of the URL and the user browser, not the same browser, can accept the maximum length is often different.

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

Also, a different Web server can accept URL lengths differently.

I also recently encountered the landlord raised this problem, the scene is in the preservation of certain information, the way to submit the form is to use the Get method, and then error, display exceeded the server request limit, because there is too much information saved, and the Get method will show the data all on the URL. Change the way to post, the problem does not exist, Baidu, said the length of the URL is limited by the browser, different browsers will have different length restrictions

Sqrtqiezi is right about that.
Both post and get are necessarily length-limited, depending on the minimum value set between the server and the browser.
Get popular with 2k for maximum

  • 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.