0
votes

I want to implement rate limiting on my simple php form.Whenever user submits more than 10 inputs in one 1s user should get blocked for certain seconds I've no idea how to implement it.If possible please tell me the way to implement with token bucket algo.

Here is my form.

  <form action="<?php echo $_SERVER['$PHP_SELF'];?>" method="POST"  >
        <input placeholder="Input" type="text" name="name">
        <button type="submit"">Click</button>

    </form>
Is the user authenticated or are you simply referring to site visitors?El_Vanja
I am referring to site visitors.k ho
How long would this block last?El_Vanja
Just for 1-2 minutes.If the request exceeds 10 ,he/she should get blocked.k ho
That's impossible to ensure for visitors. If you store the info in session, it can be avoided by restarting the browser. If you place it in the cookie, it can be deleted (or avoided with private browsing).El_Vanja