By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,718 Members | 1,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,718 IT Pros & Developers. It's quick & easy.

Invisible hit counter in php

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: 8,639
what about just not doing the echo?
Apr 22 '10 #2

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

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

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

Sign in to post your reply or Sign up for a free account.