|
Posted by Marcin Dobrucki on 10/08/72 11:42
desh wrote:
> i want that if the user tries to login with incorrect password more
> than 3 times, then he should not be allowed to login for 24 hours.
> i m trying to save the current day and time and then comparing the
> same when the user logs in.
> My problem is how to compare current date and time.
> Is there some alternate way to do the same?
24h = 86400s
...
$current = mktime();
$previous = /* something that you saved on incorrect attempts */
$diff = $current - $previous;
if ( $diff < 86400) {
/* Go to jail, do not pass "GO", do not collect $200 */
}
else {
// ...
}
Navigation:
[Reply to this message]
|