View Single Post
  #2 (permalink)  
Old 2005-07-12, 08:12 PM
NeXT NeXT is offline
Junior Member
 
Join Date: Jul 2005
Posts: 1
NeXT
Default

I'd use something like this:
Code:
<? 
$f=fopen("counter.dat","a+");
flock($f,LOCK_EX); 
$count=fread($f,100);
@$count=$count+1;
ftruncate($f,0);
fwrite($f,$count);
fflush($f);
flock($f,LOCK_UN);
fclose($f);
echo $count;
?>
I'm just learning php but I think this is the simplest script you can get..I may be wrong.
Reply With Quote