Quick and easy flood protection?

后端 未结 7 1914
忘了有多久
忘了有多久 2020-12-29 11:51

I have a site where a user submits a message using AJAX to a file called like.php. In this file the users message is submitted to a database and it then sends a

7条回答
  •  青春惊慌失措
    2020-12-29 12:32

    Use a token. You generate the token and add it to the page originating the request. In like.php you verify that the request contains a valid token, which means it comes from your page instead of an external one POSTing directly.

提交回复
热议问题