Restrict users with a number of wrong logins
<p>I have a login form in a backend application</p>

<p>I need to find a way to restrict/denied users that for example has entered a bad username/password at least five times and show a meesage like:</p>

<pre><code>echo "You have entered wrong 5 times your username/password, you have to wait 10 minutes to the next login"
</code></pre>

<p>But what do I have to save??</p>

<p>The ip or username? and where to save: file or db?</p>

<p><strong>EDIT:</strong></p>

<p>I apologise because I have no been clear in my question</p>

<p>I have implemented this system but using a file instead adding the some fields to the database</p>

<p>I can't paste the code because is huuuuuge and I think I will use the system that I'm using now</p>

<p>Thanks <strong>alex</strong> and <strong>Michael Ames</strong> for your time but can't accept your answers because I was looking for someone that it used file instead database</p>
