Jump to content

what is difference between get and post in php


Recommended Posts

  • 3 years later...

Without someone posting the full explanation for you to copy you fail miserably! It has nothing to do with database directly its sending data from one page to another, usually from form either visually through url querystring using get or hidden using post to the server.

Link to post
Share on other sites
  • 2 weeks later...

Hello @krishnanayaks

Following are the differences between GET and POST Method :

The GET Method :

The GET method sends the encoded user information appended to the page request. The page and the encoded information are separated by the ? character.

  1. The GET method produces a long string that appears in your server logs, in the browser's location.
  2. The GET method is restricted to send upto 1024 characters only.
  3. Never use GET method if you have password or other sensitive information to be sent to the server.
  4. GET can't be used to send binary data, like images or word documents, to the server.
  5. The data sent by GET method can be accessed using QUERY_STRING environment variable.
  6. The PHP provides $_GET associative array to access all the sent information using GET method.

The POST Method :

The POST method transfers information via HTTP headers. The information is encoded as described in case of GET method and put into a header called QUERY_STRING.

  1. The POST method does not have any restriction on data size to be sent.
  2. The POST method can be used to send ASCII as well as binary data.
  3. The data sent by POST method goes through HTTP header so security depends on HTTP protocol. By using Secure HTTP you can make sure that your information is secure.
  4. The PHP provides $_POST associative array to access all the sent information using POST method.

I hope above information will be useful for you.
Thank you.

 

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...