Hello, so it's time for me to make my first thread here, in hope of getting some help with this.
So my question is following,
I'd like to have a clock that says "You have been logged in for" is this somehow possible to make in php, and if so how?
thanks
You have been logged in for xx:xx
Re: You have been logged in for xx:xx
When they log in you can store the current time in the session that you presumably are creating ?
Then take this away form the current time on each page load to get the number of seconds they have been logged in.
Then take this away form the current time on each page load to get the number of seconds they have been logged in.
Re: You have been logged in for xx:xx
How would I store the time in session?jacek wrote:When they log in you can store the current time in the session that you presumably are creating ?
Then take this away form the current time on each page load to get the number of seconds they have been logged in.
Re: You have been logged in for xx:xx
$_SESSION['last_login'] = time();You would set that whenever the user logs in.
Please check out my CodeCanyon items.
-
- Posts: 534
- Joined: Thu May 05, 2011 8:19 pm
Re: You have been logged in for xx:xx
and every page ave
$current_time = time(); echo "Time logged in: " .($current_time - $_SESSION['last_login']);
I don't like to brag, but I wasn't circumcised. I was circumnavigated.
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9