This is a graphical counter made with SESSION. After the user logs in, the counter is incremented by one. It will only be incremented by one when the browser is closed and reopened.
// Counter written in SESSION,
session_start();
if (session_is_registered(count)==false){
while(($fp=fopen("counter .txt","r+"))==false);
while(flock($fp,3)==false);
$count=fgets($fp,255);
$count+ =1;
fseek($fp,0);
fputs($fp,$count);
fclose($fp);
session_register(count);
}
$len=strlen($count);
for($i=1;$i{
$imagpath="" ; //TEMP is an image folder, and the image file name needs to be 0.GIF...9.GIF
}
for($i=1;$i{
$imagpath.="";
}
print "You are the ".$imagpath." visitor";
?>