How to prevent the server side from receiving data from an unintended source

I have a PHP service called addItem.
This service is called when someone submits a form on the client side.

How can I protect this to ensure that the item will only be added when called from the intended form?
Trying to prevent someone from submitting material via an automatic curl call, for example.

Thank you
Tee

+3
source share
2 answers

, . , , , . , . , , , .

  • CAPTCHA, , , , .
  • - CSRF ( ). , , , . , .
  • , Javascript, JS CSRF. , JS , .
  • , cURL wget.
  • , ​​ POST, GET.
  • .
  • HTTP-. , , .

, - , . , , , , , .

+4

: CSRF (PHP)

, , . :

<form ...>
    <input name="csrf_dfjfi4i4i4k3" value="csrf_dfjfi4i4i4k3" type="hidden" />

, , , , .

+2

All Articles