PHP POST method - Advantages and disadvantages in forms
The most common use of a form with post method is to send data that will be stored in a database, or that will cause operations that enable access to private data (with a form of access to a private area, or registration).
The most common use of a form with post method is to send data that will be stored in a database, or that will cause operations that enable access to private data (with a form of access to a private area, or registration).
Advantages?
- One of the potential advantages of declaring in our form that the post method be used, is to get our browser to connect to the server and send the data of the form fields in an absolutely invisible, discreet way, at least in the address bar of the browser
- Of course, that makes it difficult to modify the address bar to send extra data that allows the get method, but nothing prevents a "curious" user from editing the form on your computer, and sending unexpected data to the server also using the post method
- Unlike the get method, the data sent by the post method does not have a limit regarding the number of variables sent in the same request, or the length of their values
Disadvantages? Many:
- If the access to a page depends on the sending of data to the server using the post method, every time we want to return to this page we must send again the form data, and most browsers will warn this with a warning message to the user , who will not always understand what is happening
- Another disadvantage: if the user saves a page in his favorites that received data by post, when he uses that favorite, the data he sent the first time from a form will no longer be available and, therefore, the result he will obtain will no longer be available. it will be the same (or you will get the typical alert message)
We return to reaffirm the conclusion that maintains that to send private information, we will use post; to browse public information, we'll use get.
And we'll also use get when we want our page to be saved in the user's favorites without causing usability problems.
ChatGPT Free
Ask questions on any topic
CITE ARTICLE
For homework, research, thesis, books, magazines, blogs or academic articles
APA Format Reference:
Delgado, Hugo. (2019).
PHP POST method - Advantages and disadvantages in forms.
Retrieved Dec 14, 2024, from
https://disenowebakus.net/en/post-method-php