Ok I am working on a script that I can run like this www.website.com/user.php?join to join and when they leave they do this /user.php?leave.
and when they join it echos + 1 and when they leave it subtracts 1 from the usuers
so basicly when a user logs in and runs the join part it adds + 1 to the user count but when he does leave it subtracts 1 from the user count
here is what I have so far
<?php
$fp = fopen('online.txt', 'w+');
$ro = fopen('online.txt', 'r');
$read = fread($ro, filesize("online.txt"));
if(isset($_GET['join'])) {
$read = $read + 1;
fwrite($fp, $read);
}
else {
if(isset($_GET['leave'])) {
$read = $read - 1;
fwrite($fp, $read);
}
}
echo("".$read."");
?>
but I get an error... anyhelp?