Tokiwa Battle Royale  GE777
A PHP Battle Royale inspired game
 All Data Structures Namespaces Files Functions Variables Pages
stat.php
Go to the documentation of this file.
1 <?php
2 
3 define('CURSCRIPT', 'stat');
4 
5 require './include/common.inc.php';
6 
7 $k=(int)$_GET['lim'];
8 
9 $result = $db->query("SELECT ip FROM {$tablepre}users WHERE lastgame>='$k'");
10 
11 $cnt=0;
12 
13 while ($dat = $db->fetch_array($result))
14 {
15  $data=$dat['ip'];
16  $i=strlen($data)-1;
17  while ($i>=0 && $data[$i]!='.') $i--;
18  if ($i<0) echo "something wrong..";
19  $data=substr($data,0,$i);
20  //echo $data."<br>";
21  if (!isset($hash[$data])) { $hash[$data]=1; $cnt++; }
22 }
23 
24 echo $cnt;
25 
26 ?>
$cnt
Definition: stat.php:11
$i
Definition: botservice.php:267
$db
Definition: clear.php:32
$result
Definition: stat.php:9
$k
Definition: stat.php:7