Loading...

Post versus Get

We have used the  GET  method of the  <form>  tag: < form method = " GET " > < / form > We saw it appends a...

We have used the GET method of the <form> tag:
<form method="GET"></form>
We saw it appends a query string to the URL when the form is submited.
http://localhost/preferences.php?font-color=red&background-color=yellow
There is another method of sending the information, the POST method:
<form method="POST"></form>
The POST method sends the information in the HTTP message header. The URL of the called page will not include the query string and the information transfer will be transparent to the user. This technical difference is not the only difference and is not the most important.
The most important difference is semantic. When you use GET you are implying that nothing will be changed when you submit the form, while when POST is used something will be permanently commited.
So if you will be doing a database query GET is preferred and when confirming a pizza order POST is the way to go. There is nothing preventing you from doing the opposite, but we will see that it will not work as well.
PHP Tutorial 2681013814298089442

Post a Comment

emo-but-icon

Home item

ADS

Active Search Results

Popular Posts

Labels

Random Posts

Submit Articles for Free
Authors can submit copyright free articles and enjoy the many benefits provided by ArticleGeek.com.

Flickr Photo