← CodePrimer
HTML Beginner Forms

GET vs POST forms

When should a form use GET or POST?

Method choice for forms.

Sample
<form action="/search.php" method="get">
  <input type="search" name="q">
  <button type="submit">Search</button>
</form>

<form action="/login.php" method="post">
  <input type="email" name="email">
  <input type="password" name="password">
  <button type="submit">Log in</button>
</form>

Notes

GET is shareable (search). POST for login/create/update.

Keywords: get · post · method · form

Related

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share