Need help ASAP: how to limit login attempts

I’ve been searching a lot but I can’t seem to understand how to do it. Can someone explain how to simply limit login attempts to 5 times per hour? T_T I’m just new to this

You could use sessions to store the number of failed attempts.
On each failure you would increment the fail count by one. If the count reaches five you can store a timestamp in a session.
On trying to access the login form you would check the number of fails, blocking if the number is five and the timestamp is less than an hour ago when compared to the current time.

I highly don’t recommend trying to create a login system on your own if you are new to PHP itself. Login systems are super complex for someone beginning PHP. You don’t even know the basics of PHP yet and you’re trying to make a login system. Login systems require an extensive knowledge in web security, general security, and fluent in the programming language you are using. If you don’t have at least one of these 3 characteristics, I would never recommend making a login system. You are just setting yourself up to get hacked.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.