Nombre de personnes connectées
Bonjour,
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| $num_visitor = 0;
if(@file_exists('counter.txt')){
if(($counter = @fopen('counter.txt', 'r')) === FALSE)
echo 'Warning:Unable to open the counter file.';
if(($num_visitors = (int)@fgets($counter)) === FALSE)
echo 'Warning:Unable to read the file.';
if(@fclose($counter) === FALSE)
echo 'Warning:Unable to close the file.';
}
if(!isset($_SESSION['new_visitor'])){
$_SESSION['new_visitor'] = 1;
$num_visitors ++;
if(($counter = @fopen('counter.txt', 'w')) === FALSE)
echo 'Warning:Unable to open the counter file.';
if(@fwrite($counter, $num_visitors) === FALSE)
echo 'Warning:Unable to save the data.';
if(@fclose($counter) === FALSE)
echo 'Warning:Unable to close the file, the data mignt be lost.';
} |
Est-il possible de savoir combien ya t-il de connecté mais cette fois-ci en même temps et avec leur compte??
Cordialement!!