Rama Sekharan' Photos
Link to Rama's photos on Ofoto
Link to additioal photos on Ofoto
Return Home
Send mail to Danube@BruceSnow.US with questions or comments about this web site.
08/6/2004
$CounterFile="danube_count.dat";
$UniqueFileID="$SERVER_NAME--$DOCUMENT_URI";
$UniqueHash=bin2hex(md5($UniqueFileID));
$FilePointer=fopen($CounterFile,"r+");
flock($FilePointer,LOCK_EX);
while ($FileCount = fscanf ($FilePointer, "%s\t%s\n"))
{
list($HashID,$Count)=$FileCount;
$CountHash[$HashID]=$Count;
}
$CountHash[$UniqueHash]=$CountHash[$UniqueHash]+1;
rewind($FilePointer);
$CountKeys=array_keys($CountHash);
foreach($CountKeys as $TheKey)
{
fwrite($FilePointer,"$TheKey {$CountHash[$TheKey]}\n");
}
flock($FilePointer,LOCK_UN);
fclose($FilePointer);
print "This page has been accessed {$CountHash[$UniqueHash]} times.";
?>