Advertisement
Advertisement
| 04.04.2008 at 11:28AM PDT, ID: 23296960 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: |
<?php
include_once("config.php");
$timestamp = time();
$timeoutseconds = '';
$timeout = $timestamp-$timeoutseconds;
$ip = $_SERVER['REMOTE_ADDR'];
// Add this user to database
$loopcap = 0;
$query = "INSERT INTO online values('".$timestamp."','".$ip."','".$_SERVER['PHP_SELF']."')";
while($loopcap<3 && @mysql_query($query)){
// in case of collision
$timestamp = $timestamp+$ip{0}; $loopcap++;
}
// Delete users that have been online for more then "$timeoutseconds" seconds
@mysql_query("DELETE FROM online WHERE timestamp < $timeout");
// Select users online
$result = @mysql_query("SELECT DISTINCT ip FROM online");
$user = @mysql_num_rows($result);
mysql_free_result($result);
@mysql_close();
// Show all users online
if ($user==1){
echo $user.' user online';
}else{
echo $user.' users online';
}
?>
|