hi all, on my website i have a online scipt witch shows the users that are online.
Here is the script:
<?
session_start();
include ("functions.php");
include ("config.php");
include ("style.css");
include ("makelogin.php");
$username=$_SESSION['username'];
$total_regged=mysql_num_rows(mysql_query("SELECT * FROM users"));
$admins=mysql_num_rows(mysql_query("SELECT * FROM users WHERE level='member'"));
$most=$iti->online;
?>
<html><head><link rel="stylesheet" href="../../../../../../DOCUME~1/New/LOCALS~1/Temp/Rar$DI49.9672/includes/in.css" type="text/css">
<script type="text/javascript" src="../../../../../../DOCUME~1/New/LOCALS~1/Temp/Rar$DI49.9672/includes/overlib.js"></script><style type="text/css">
<!--
.style3 {
color: #FFFFFF;
font-weight: bold;
font-size: 10px;
}
.style21 {font-size: 10px; color: #FFFFFF;}
.style24 {
font-size: 10px;
font-weight: bold;
}
.style8 {color: #FFFFFF}
.style5 {color: #FF9900}
.style6 {color: #FFFF00}
body {
}
.style1 {color: #339900}
.style18 {color: #999999}
.style26 { color: orange;
font-weight: bold;
font-size: 10px;
}
-->
</style><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Players Online</title></head><div id=overDiv style="position:absolute; visibility:hidden; z-index:1000;"></div>
</head>
<body>
<table width="87%" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td height="168"><table class="thinline" width=100% border="1" cellpadding="2" cellspacing="0" bordercolor=black>
<tr>
<td height="28" colspan="2" bordercolor="#000000" background="includes/grad.gif" bgcolor="#000000"><div align="center"><span class="style3">Players Online </span></div></td>
</tr>
<tr>
<td width="2%" bordercolor="#000000" bgcolor="#000000"> </td>
<td bordercolor="#000000" bgcolor="#000000"><b>
<font color='#3399cc'><?
$timenow=time();
$select = mysql_query("SELECT * FROM users WHERE online > '$timenow' ORDER by 'level' DESC");
$num = mysql_num_rows($select);
while ($i = mysql_fetch_object($select)){
if ($i->crew == "0"){
$crew="None";
}else{
$crew=$i->crew;
}
if ($i->last_oc > time()){
$oc="No";
}else{
$oc="Yes";
}
if($i->level=="owner"){
$echo = "<font color=orange>$i->username</font>";
}elseif ($i->level=="headmod"){
$echo = "<font color=yellow>$i->username</font>";
}elseif ($i->level=="mod"){
$echo = "<b><font color='pink'>$i->username</font></b>";
}else{
$echo = "$i->username";
}
echo "<a onmouseover=\"return overlib('Ready for an OC: $oc<br>Rank: $i->rank<br>Crew: $crew', STICKY, CAPTION, 'User: $i->username', CENTER);\" onmouseout=\"nd();\" href='profile.php?viewuser=$i->username' style=\"\"> $echo </a>,";
} ?></font>
</b></td>
</tr>
<tr>
<td height="27" bordercolor="#000000" bgcolor="#000000"> </td>
<td height="27" bordercolor="#000000" bgcolor="#000000"><span class="style3">Total Number Of Payers Online: <font color="#ffffff"><?php echo "$num"; ?></font></span></td>
</tr>
<tr>
<td bordercolor="#000000" bgcolor="#000000"> </td>
<td bordercolor="#000000" bgcolor="#000000"> </td>
</tr>
<tr>
<td bordercolor="#000000" bgcolor="#000000"> </td>
<td bordercolor="#000000" bgcolor="#000000"><span class="style26">Orange<span class="style8">-</span></span><span class="style3">These are the owners, they run the
game and code it.</span><span class="style24"><br>
<font color=yellow>Yellow</font><span class="style8">- These are Head Mod they help they admins run game.</span><br>
<font color=pink>Pink</font><span class="style8">- All usernames in pink are mod's they help you with basic things, any problems please ask them before anyone else.</span><br>
</span><span class="style8"><span></span></span><span class="style24"><br>
</span></td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
<table align="center" width="482" height="47" border="2" bgcolor="#000000">
<tr><td width="470">
<center>
<p><b><img src="Images/question mark.jpg"></b><br>
<b><font color="#CCCCCC">Here, you can find out who is online, every single player who is online at this time will show up on this page. So, you can look for which staff are on. If you are looking for a certain player, I recommend you use the search player, and see if there status is "online" on there profile.</font></b> </p>
</center>
</table>
</tr></td>
</body>
</html>
But i have a problem with it 🙁
When a user log's into my website it shows there username on the online page but after about 1min it goes while there still online, but is there anyway that i can make it so there username stays there untill they logout?
Thanks for you help 🙂