![]() |
Simple PageViews Counter
I just created this for one of my client
Create A File Called counter.txt With CHMOD 777 In The Root Directory $Visits = file_get_contents("counter.txt"); file_put_contents("counter.txt", $Visits++); It works great like statcounter and other programs which also does not do much like unique ip tracking and other stuff. |
Re: Simple PageViews Counter
dear izaan we can create counter.text easily but how to create "counter.txt With CHMOD 777"
and where can we use that script "i understood but i mean that please show me in a html page in a real scenario to download that script & then i can use in my page " please help me boss. waiting for your reply. |
Re: Simple PageViews Counter
counter.txt with CHMOD 777 means it should be read and writable by the PHP script.
In windows you need to set the needed permission using IIS and for Linux its simply changing the file permission. I have not tested but it should work with chmod 666 as well as you do not need to execute anything. |
Re: Simple PageViews Counter
I really doubt it worked.
PHP Code:
change it to PHP Code:
|
Re: Simple PageViews Counter
If you want it to keep track of IP's why not have it hold it as an array in a separate file.
PHP Code:
|
| All times are GMT +5.5. The time now is 17:17. |