ndstats

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
mobileplaza
-


Joined: 04 Apr 2005
Posts: 35

PostPosted: Mon Apr 25, 2005 9:24 pm    Post subject: ndstats Reply with quote

hey peps havin trouble getting this little php script working... any help appreciated. or

if anyone has any easy hit counter/stat display for a website..
Back to top View user's profile Send private message
FosoFish
-


Joined: 23 Apr 2005
Posts: 22

PostPosted: Tue Apr 26, 2005 4:18 am    Post subject: Reply with quote

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.
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group