FosoFish -
Joined: 23 Apr 2005 Posts: 22
|
Posted: Tue Apr 26, 2005 4:18 am Post subject: |
|
|
I have one,
First make a counter1.dat file in the directory you picked for your htm/php files.(default is htdocs in the Abyss folder). the .dat file holds the number of visitors. the php code is : Code: |
$counterfile = "counter1.dat";
if(!($fp = fopen($counterfile,"r"))) die ("cannot open counter file");
//read the value stored in the file
$thecount = (int) fread($fp, 20);
//close the file
fclose($fp);
//increment the count
$thecount++;
//display the count
echo "visitor no : $thecount";
//open the file again in write mode and store
// the new count
$fp = fopen($counterfile, "w");
fwrite($fp , $thecount);
//close the file
fclose($fp);
?>
|
And thats it! I found this on a site somewhere, i forgot though =/, credit to them. |
|