Hiya.
New query for you please. ?
We have a login system on our site which is based mostly on PHP sessions, but also uses cookies for the login date and time.
From our login.php upon a successful login the following is set:
[code=php]
$_SESSION[‘logged’] = true;
$_SESSION[‘account’] = $account;
$_SESSION[‘password’] = $password;
$_SESSION[‘ip’] = $_SERVER[‘REMOTE_ADDR’];
setcookie(‘logindate’, date(‘d/m/Y’));
setcookie(‘logintime’, date(‘H:i:s’));
The actual data is stored in a users.txt flatfile db which is protected, and has a layout of:
[code]user,md5pass
I can paste the entire code if it helps.
My query though is it possible based on this flatfile to create an ‘online.php’ which will show all active users who are logged in (have the ‘logged’ session var) and say what their session age has been based on the cookie? If it’s too difficult with the session age that’s not a problem, but it would be nice for the users who are logged in to be displayed in a ul/li format.
Any advice on this will be much appreciated. ?
Thanks.