Receiving data by POST method

22. 8. 2019

Sending data by POST is quite different from GET, it is safer, the text can be longer and its value cannot be determined except by a form or a header (which you will not get by mistake).

Source

Source is not that different from the GET method. It's pretty much the same, except the parameters are not displayed in the URL, only the filename is visible.

php
echo $_POST['clanek'] ?? '';

Characteristics, advantages and disadvantages

  • Parameters cannot be linked to, but a form must be sent to them
  • Cannot be indexed (related to the previous point)
  • Safer than GET (data is sent in a hidden way, values are not displayed in the history)
  • Not to be confused with SSL, POST is not encrypted
Jan Barášek
Jan BarášekVíce o autorovi

Autor článku pracuje jako seniorní vývojář a software architekt v Praze. Navrhuje a spravuje velké webové aplikace, které znáte a používáte. Od roku 2009 nabral bohaté zkušenosti, které tímto webem předává dál.

Rád vám pomůžu:

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.