Date: 11/13/00
- Next message: kenji chan: "Re: [PHP-DB] How many users"
- Previous message: kenji chan: "Re: [PHP-DB] Web-base Files upload"
- In reply to: Enrico Comini: "[PHP-DB] How many users"
- Next in thread: kenji chan: "Re: [PHP-DB] How many users"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
""Enrico Comini"" <algobit <email protected>>
news:NCBBIOBMPJJBPJICNDLLCEKDEBAA.algobit <email protected>
> There is a way in php to check the number of users connected to site ?
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe <email protected>
> For additional commands, e-mail: php-db-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>
*************
yes, the code here !!!!
**online.php**
<HTML>
<HEAD>
<TITLE>Kenji PHP Online</TITLE>
</HEAD>
<BODY background="" BGCOLOR="#006699" onLoad="updateTime()">
<center>
<div ID="TimeDiv" style="position: absolute; left: 100; top: 100;"></div>
<?php
$refreshmin = 6;
$ofile = fopen("i.love.sandy","w");
flock($ofile,1);
while ($buffer = fgets($ofile, 4096)) {
list($temp, $thetime) = split(",", $buffer, 2);
if ((time() - $thetime) < ($refreshmin * 60)) {
$users[$temp] = $thetime;
$countnow++;
}
}
flock($ofile,3);
fclose ($ofile);
$key = getenv("REMOTE_ADDR");
if (!(isset($users[$key]))) {$countnow++;}
$users[$key] = time();
$nfile = fopen("i.love.sandy","w");
while (list($key, $val) = each($users)) {
fwrite($nfile,"$key,$val\n");
}
fclose ($nfile);
?>
</center>
<SCRIPT language="JavaScript">
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
var now = new Date(<?php echo date("Y"),",",date("n")-1,",",date("d,H,i,s")
?>);
var diff = new Date;
var iTimed = new Date;
var base = new Date;
var old = 0;
function updateTime() {
var CDate = new Date;
diff.setTime(CDate.getTime()-now.getTime());
printTime();
}
function printTime() {
var CDate = new Date;
now.setTime(CDate.getTime()-diff.getTime());
iTimed.setTime(now.getTime() - 25200000)
txt = now.getHours() +":" + TwoDigits(now.getMinutes()) + ":" +
TwoDigits(now.getSeconds());
var iTime = Math.floor((iTimed.getHours() * 3600 + iTimed.getMinutes() * 60
+
iTimed.getSeconds()) * 5 / 432);
txt += " iTime @" + iTime;
if ((CDate.getTime()-base.getTime())>300000) {
location.reload(true);
}
txt = '<span style="font-family: ; font-size: 12pt;"><B>'+txt+'<?php
print("<BR>$countnow People")?>'+'</B></span>';
if (ns4) {
var lyr = document.TimeDiv.document;
lyr.write(txt);
lyr.close();
}
else if (ie4) document.all["TimeDiv"].innerHTML = txt;
setTimeout("printTime()",1000);
}
function TwoDigits(a) {
if (a<10) {
a = "0" + a;
}
return a;
}
</SCRIPT>
</BODY>
</HTML>
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: kenji chan: "Re: [PHP-DB] How many users"
- Previous message: kenji chan: "Re: [PHP-DB] Web-base Files upload"
- In reply to: Enrico Comini: "[PHP-DB] How many users"
- Next in thread: kenji chan: "Re: [PHP-DB] How many users"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

