Hello good people of TSDN! I have a little script here that need help with... I want a script that tells me how many people are viewing a page or a directory at a time, EG: How many users are on index.php or how many users are in the /forums directory. I have a hit counter script that i will post here for anybody wanting one, and i think it works great, i just need a counter that goes down when a user leaves directory. I would also like a counter that counts how many people have the session string ['userid'] in their browser, which is m sites way of telling if your logged in or not. Can somebody please help me on this?
The counter code:
[CODE=php]<?php
$count_my_page = ("hitcounter.tx t");
$hits = file($count_my_ page);
$hits[0] ++;
$fp = fopen($count_my _page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
echo $hits[0];
?>[/CODE]
PS: I wish not to use MySQL, i don really like that database type... Long ago i made a deal with MySQL, i said "Be nice and work for me, and i will allow you to exist..." MySQL got mad and said "I am never nice to amateurs such as yourself! Muahaha" So i took my database and shot it square between the Y and the Q.
The counter code:
[CODE=php]<?php
$count_my_page = ("hitcounter.tx t");
$hits = file($count_my_ page);
$hits[0] ++;
$fp = fopen($count_my _page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
echo $hits[0];
?>[/CODE]
PS: I wish not to use MySQL, i don really like that database type... Long ago i made a deal with MySQL, i said "Be nice and work for me, and i will allow you to exist..." MySQL got mad and said "I am never nice to amateurs such as yourself! Muahaha" So i took my database and shot it square between the Y and the Q.
Comment