Having trouble if else statement
For some reason its not getting to the part of line 174 and I don't know why. Any suggestions what the solution coul开发者_如何学Cd or might be.
http://pastebin.com/vFZwmJuc
$minutes
might never be less than 10?
echo
$minutes
on line 173 to check
Why .. why so many useless calculations (lines 159-163)? From what I see you need to find out the difference in minutes only. If so -- replace the above mentioned lines by this:
$minutes = floor($diff / 60);
Test Examples:
$currTime = '2011-06-12 10:27:00';
$lockTime = '2011-06-12 10:26:05';
$diff = abs(strtotime($currTime) - strtotime($lockTime));
$minutes = floor($diff / 60);
echo $minutes, "\n";
$currTime = '2011-06-12 10:27:00';
$lockTime = '2011-06-12 09:26:05';
$diff = abs(strtotime($currTime) - strtotime($lockTime));
$minutes = floor($diff / 60);
echo $minutes, "\n";
Test Results:
0
60
EDIT: Also, on line 174 -- your text is Your account is currently locked. You must wait ' .$chancesLeft.' minutes before you can log in again!
. The message tells about minutes but $chancesLeft is used.
精彩评论