Hello all

A frind of mine likes to count the impressions on each of his photgraphy online
and as well he likes to display this number under each image

he dosn't wish to use for each image a new request to the different count script 
..all should be counted with one script and saved in one datafile 

//   Code start 

//  Image ID
$ImageNr=$HTTP_GET_VARS['n'];
if(!$ImageNr){$ImageNr=0;}

// Full sys path to count.txt 
$counter_file = "count2.txt"; 
 
// Puts the file lines into $counter_file_line array 
$counter_file_line = file($counter_file); 
 
// adds one to the number in the [0] array or the very first line 
$counter_file_line[0]++; 
 
//  I use a+ well I need each line representing an induvitual image ? ??
// opends the file and then writes the new number and then closes it 
$cf = fopen($counter_file, "a+"); 
fputs($cf, "$counter_file_line[0]");   
fclose($cf); 
 
// prints out the full count 

// ??
echo " Views $counter_file_line[0] "; 

//  Code end

Reply via email to