comparing day and time

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
hello friends
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?

Re: comparing day and time

desh wrote:

Quoted text here. Click to load it

   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 {
    // ...

Re: comparing day and time

thanks  Marcin

I m newbie to php and I was not aware of this function mktime(). thanks

DeshRaj Singh

Site Timeline