You are here: Re: comparing day and time « PHP Programming Language « IT news, forums, messages
Re: comparing day and time

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация