-3

Can U tell me what are the advantages and reasons of using GET method in php?

Why even use it if there is POST? Why do some websites use both GET and POST at the same time?

Can U name main reasons? cheers

Piter
  • 51
  • 1
  • 1
  • 6
  • There are more than just get and post https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html – Chay22 Jul 06 '16 at 18:55
  • Because I'd rather send you to http://stackoverflow.com/questions/38231659/php-get-method-what-for to take a look at this specific question than either a) have to build a form on its own unique domain/subdomain name just so you can get the right POST data to go there or b) have to give you instructions on going to SO and searching for it. – ceejayoz Jul 06 '16 at 18:57

2 Answers2

0

One main advantage is, when you have parameters sent with GET, you URL contains all the information for the page to handle. So, you can Bookmark that link. You cannot do that if the data is sent with POST. More technical details here: What is the difference between POST and GET?

Community
  • 1
  • 1
Rajat Shah
  • 241
  • 1
  • 7
  • 18
0

The GET method is useful in situations where the GET variable is used to display particular data from your website, such as maybe the results of a movie lookup or something, because the GET variable is part of the URL, thus it can be bookmarked. POST variables are passed invisibly to the user, so can't be used for this purpose. Typically, you would use GET variables to request data from a database, and POST variable to send data to your database.

Sgt AJ
  • 768
  • 4
  • 11