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

PHP POST method - Advantages and disadvantages in forms | Learn PHP & MySQL | 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

Participates!

Share it with your friends in Social Networks!

Professor at the University of Guadalajara

Hugo Delgado Desarrollador y Diseñador Web en Puerto Vallarta

Professional in Web Development and SEO Positioning for more than 10 continuous years.
We have more than 200 certificates and recognitions in the Academic and Professional trajectory, including diploma certificates certified by Google.

CONTINUE LEARNING

IT ALSO DESERVES TO PAY TO VISIT:

Not finding what you need?

Use our internal search to discover more information
Related content:

Would you like to learn more about Web Design?

Meet all the courses and tutorials that we have for you completely free
Learn Web Design
 

Leave your Comment

SPONSOR

Your business can also appear here. More information

Your browser has blocked advertising.
Please 🙏 Allows you to view the ads to access, thank you.