use database to keep track log in attempt
<p>I know this question might be duplicate of other similar questions but I couldn't find a proper answer, sorry if I didn't show you the code becuase I am not sure how to do it.</p>

<p>I try to create a login page in PHP, but I want to keep track of the users log in attempt if they didn't sucessfully log in. I assume using database but don't know how exactly to do it. </p>

<p>what I want is that when people failed after three attempt it should generate an alert dialogue (modal window will be even better) and when user click OK in the alert the log in window should be closed as well.</p>

<p>After that if the user go to the login page again, the login form should not be shown to the user again within an hour, I assume to use ip or session to block it. But since the user not logged in, I don't know if I can store the ip in the database. s</p>

<p>Can anyone help me with that? Any help would be greatly appreciated! </p>
