Can anyone help me how to create a hitcounter using the textfile
i.e I've to read the text file and increment the value and again write the incremented value to the text file....
and the incremented value is printed..
Hi, Try using this if (file_exists("counter.txt")){ $fr=file("counter.txt"); $count= (int) $fr[0]; } else { $count=1; } $fp=fopen("counter.txt","w+"); $newcount=$count+1; $fr=fwrite($fp,$newcount);
Cheers Ajay