"; # Then we'll make a unique hash... $UniqueHash=bin2hex(md5($UniqueFileID)); # DEBUG # print "

"; # Lock the file. $FilePointer=fopen($CounterFile,"r+"); flock($FilePointer,LOCK_EX); # Read in the values in the counter file. while ($FileCount = fscanf ($FilePointer, "%s\t%s\n")) { list($HashID,$Count)=$FileCount; $CountHash[$HashID]=$Count; } # Increment the number of accesses to the counter file. $CountHash[$UniqueHash]=$CountHash[$UniqueHash]+1; # Rewind to the beginning of the file rewind($FilePointer); # Iterate through each element of the hash and write it to the file. # By dropping all the hashes into an array. $CountKeys=array_keys($CountHash); # Step through the array to write them to the file. foreach($CountKeys as $TheKey) { fwrite($FilePointer,"$TheKey {$CountHash[$TheKey]}\n"); } # Unlock and close the file. flock($FilePointer,LOCK_UN); fclose($FilePointer); # print out the result. # print "This page has been accessed {$CountHash[$UniqueHash]} times."; ?>
Nite I's Logo


What's New?

The I Spy Webcam Adapter is here!

Our Denim Shirts are here!
2-inch Helical Focuser is ready click here!





Return to the Nite I's Home Page