Skip to the content.

GET vs. POST

## When to use GET?

Note: GET should NEVER be used for sending passwords or other sensitive information!

<html>
  <body>
    <form action="welcome_get.php" method="get">
      Name: <input type="text" name="name" /><br />
      E-mail: <input type="text" name="email" /><br />
      <input type="submit" />
    </form>
  </body>
</html>

When to use POST?

Note: Developers prefer POST for sending form data.

<html>
  <body>
    <form action="welcome.php" method="post">
      Name: <input type="text" name="name" /><br />
      E-mail: <input type="text" name="email" /><br />
      <input type="submit" />
    </form>
  </body>
</html>

Ref: https://www.w3schools.com/php/php_forms.asp