English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

With an HTTP GET, all the form variables are visible in the URL after the question mark. A form using the GET method generates a URL like this:

http://example.com/search.php?string=pizza

So sending a form via GET looks the same to a server as clicking a hyperlink does.

With a POST, the form data is sent more like a message attached to the user's request. The maximum amount of data you can send to the server is greater because you are not limited by the maximum URL size. Use POST if you have alot of inputs, use text boxes, or want to improve the user's privacy -- the data does not show up in the URL and cannot be bookmarked.

2006-08-06 19:39:18 · answer #1 · answered by G. Whilikers 7 · 0 0

The difference has nothing to do with PHP; it is defined in the HTTP.

With GET requests, all name-value paris are contained in the URL. This means that there is a limit to how much data you can transmit in a request.

With POST requests, name-value pairs are transmitted as HTTP headers; this way, you can have "clean" (human-readable) URLs and send more data, including file uploads.

2006-08-09 06:51:49 · answer #2 · answered by NC 7 · 0 0

fedest.com, questions and answers