php - Refresh time on via javascript (systemtime) -
i have own php loginsystem. users logged out after 5 min of inactivity. want show timer in right top corner display countdown.
at moment using javascript.
like (pseudo, haven't code here @ moment):
var mytime = <?php echo time(); ?>; window.setinterval(mytime = mytime - 1; $("#timertext").text(mytime), 1000);
but don't solution. use current system time (php) , subtract time, user active @ last.
i found solution current system time via ajax. idea?
what think realize counter? there smart solution? maybe other way?
Comments
Post a Comment