364,111 Members | 2089 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

Invisible hit counter in php

ghjk
100+
P: 250
I want to put invisible hit counter to multiple pages of web site. I put visible counter like follow. There is a text file which is use to save counts. and there is a php file including the following code.And finally I put echo
Expand|Select|Wrap|Line Numbers
  1. echo $hits[0]; 
to display the hits. Now I want to invisible these hits and also add to multiple pages. Surf the internet and didn't find a answer to my problem. Could some one plese help me...

counter.php
Expand|Select|Wrap|Line Numbers
  1. $count_my_page = ("hitcounter.txt");
  2. $hits = file($count_my_page);
  3. $hits[0] ++;
  4. $fp = fopen($count_my_page , "w");
  5. fputs($fp , "$hits[0]");
  6. fclose($fp);
  7.  
Apr 22 '10 #1
Share this Question
Share on Google+
4 Replies


Dormilich
Expert Mod 5K+
P: 6,608
what about just not doing the echo?
Apr 22 '10 #2

ghjk
100+
P: 250
But then admin have to access the web folder to check it.
Apr 22 '10 #3

Dormilich
Expert Mod 5K+
P: 6,608
what else is the purpose of an invisible counter?
Apr 22 '10 #4

ghjk
100+
P: 250
only admin should see it. I found the solution. just I check the access level and show the hit counter.
Apr 22 '10 #5

Post your reply

Help answer this question



Didn't find the answer to your PHP question?

You can also browse similar questions: PHP