Hi guys,
I'm still learning PHP and now I'm working on my membersystem.
I'm using a tutorial with a complicated example.
Now, almost every page in my script contains this script below in it
with require('bottomline.php')
This is what my welcome-page displays (welcome-page requires bottomline.php)
Welcome Jan, Click here to logout change pass update profile
What I don't understand about this script is:
Should the date be displayed on my welcome screen as well?
and if it's not, what is this ment for:
$gap=10; // change this to change the time in minutes, This is the time for which active users are collected.
$tm=date ("Y-m-d H:i:s", mktime (date("H"),date("i")-$gap,date("s"),date("m"),date("d"),date("Y")));
<?php
////// To update session status for plus_login table to get who is online ////////
if(isset($SESSION['id'])){
$tm=date("Y-m-d H:i:s");
$q=mysql_query("update plus_login set status='ON',tm='$tm' where id='$SESSION[id]'");
echo "<br/>Welcome $_SESSION[userid] Klik <a href=logout.php>hier om uit te loggen</a> |
<a href=change-password.php>Change pass</a>|
<a href=update-profile.php>update profile</a><br/>";
echo mysql_error();}
else{
echo "<div align='center'><a href=login.php>Bent u reeds lid, log dan in</a></div>";
}
$gap=10; // change this to change the time in minutes, This is the time for which active users are collected.
$tm=date ("Y-m-d H:i:s", mktime (date("H"),date("i")-$gap,date("s"),date("m"),date("d"),date("Y")));
//// Let us update the table and set the status to OFF
////for the users who have not interacted with
////pages in last 10 minutes ( set by $gap variable above ) ///
$ut=mysql_query("update plus_login set status='OFF' where tm < '$tm'");
echo mysql_error();
/// Now let us collect the userids from table who are online ////////
$qt=mysql_query("select userid from plus_login where tm > '$tm' and status='ON'");
echo mysql_error();
?>
Thank you,