Loading...


bookmark - Does any one have a php counter script? Free counter script?

Does any one have a php counter script? - Free counter script?

 
 Discussion by prodigy with 15 Replies.
 Last Update: February 27, 2005, 2:22 pm
 
bookmark - Does any one have a php counter script? Free counter script?  
Quickly Post to Does any one have a php counter script? Free counter script? w/o signup Share Info about Does any one have a php counter script? Free counter script? using Facebook, Twitter etc. email your friend about Does any one have a php counter script? Free counter script? Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

Does anyone know of a good counter script i could use to display the number of clicks/hits on a download link on one of my sites?











   Fri Aug 20, 2004    Reply         

First upload a file anmed 'counter.txt' and chmod it to 666 with your ftp.
Then put this on your file:

CODE

<?php[br]$count = file_get_contents('counter.txt')+1;[/br]fwrite(fopen('counter.txt', 'w+'), $count);[br]echo $count;[/br]?>

   Sat Aug 21, 2004    Reply         

cheers roly for the nice simple script.

   Sat Aug 21, 2004    Reply         


QUOTE (Roly)

First upload a file anmed 'counter.txt' and chmod it to 666 with your ftp.
Then put this on your file:

CODE

<?php[br]$count = file_get_contents('counter.txt')+1;[/br]fwrite(fopen('counter.txt', 'w+'), $count);[br]echo $count;[/br]?>

uhh... shouldn you chmod it to 777 not 666?

   Sun Aug 22, 2004    Reply         

QUOTE (jailbox)

uhh... shouldn you chmod it to 777 not 666?

You can chmod it to any of those

   Sun Aug 22, 2004    Reply         

I want to have a counter in my site but i would like to have it only increased everytime the user enters my homepage at the first time. I mean if i user goes to a subsection of my site and clicks the back button coming back to the home page i do not want the counter to be increased again (with Roly's counter the counter will be increased).
I think the solution will be to create a counter which interacts with sessions or something like that.
Does anyone has a counter which works as i explained?
Thanks in advance.
Sergio







   Fri Aug 27, 2004    Reply         


:D When you redirect to address for download then use counter as same ! It's very simple !

   Fri Aug 27, 2004    Reply         

i prefer using awstat a free website statics its more than a hit counter :P

   Tue Aug 31, 2004    Reply         

you can Found it in www.hotscripts.com
or Search in google.com

   Tue Sep 14, 2004    Reply         

   Tue Sep 14, 2004    Reply         

hi

i tested over 500 counter and statistic scripts (big numer load of time)

look goyz
i have selected 10-20 of the best(be adviced that i dont use txt scripts only the ones based on Db's)

if any want a name or a script
just pm me


take care

   Tue Sep 14, 2004    Reply         

The php counter script I use for all my sites is phphits v1.1 found at www.johannesgamba.com. It's very handy because you can set the time duration of what counts as a "new" hit, and you can display the number of users online in a duration of time, and also the number of hits in the last 24 hours. It also has a log page with statistics of what users came at what time, their IP and what page they hit. Very handy.

Also it's very easy to use if you know the basics of php. It uses a MySQL database.

   Wed Sep 15, 2004    Reply         

This will not work in a busy web site. Because there are many concurrent access, we need some mechanism to synchronize the access.

The error is
1 The count may not be correct. Suppose one request get count=1. At the mean time, another request get the same count=1. after both write finish, count=2 instead of count=3
2 The write to the file may cause the file corrupt, because fopen is not locked even you open it for write.

the process should be:

<?
fopen()
flock(LOCK_EX)
fread()
count++
fwrite()
flock(LOCK_UN)
fclose()

?>

QUOTE (Roly)

First upload a file anmed 'counter.txt' and chmod it to 666 with your ftp.
Then put this on your file:

CODE

<?php
$count = file_get_contents('counter.txt')+1;
fwrite(fopen('counter.txt', 'w+'), $count);
echo $count;
?>


   Mon Jan 31, 2005    Reply         

omg.. the last post in this thread was over 4 months ago.. And the original poster isn't even a member of the board anymore! Why bring back a thread that has been dead for so long? Arrrrrggh..

   Mon Jan 31, 2005    Reply         

The others can find what they want when search in the forum. Do you want others to get the wrong answer? :D

QUOTE (no9t9)

omg.. the last post in this thread was over 4 months ago.. And the original poster isn't even a member of the board anymore!  Why bring back a thread that has been dead for so long?  Arrrrrggh..

   Mon Jan 31, 2005    Reply         

This is Fan Post
Where can i find this CMS is really funny
So , U Can find Many Website support PHP Scripts Like hotscripts.com and You can search on search EN and u can find many tutoial about Flatfile And SQL for Counter Script and u can Use CGI Counter in Cpanel
I think best counter is Cpanel Counter
No DB No File Easy And Fast And No Space for upload Files :D

   Sun Feb 27, 2005    Reply         

Quickly Post to Does any one have a php counter script? Free counter script? w/o signup Share Info about Does any one have a php counter script? Free counter script? using Facebook, Twitter etc. email your friend about Does any one have a php counter script? Free counter script? Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

Similar Topics:

Php News Script

How to make a News script with PHP + MySQL So..in this tutorial i will explain how to create PHP news script. first we have to create the table in My SQL.. with the code below you will do this ( you have to enter it into SQL field ..in PHPmyADMIN) ...more

   17-May-2005    Reply         

Php Upload Files To Secure Director...

Hello all you great PHP peeps. I'm trying to upload a few PDF documents that I scanned for the clients, like invoices, confidentiality agreements, etc. I want them to register, login, and be able to see their profile and documents they have access to. I will either FTP the files via Filezilla ...more

   30-Oct-2009    Reply         

Php From File To Javascript

Hey All, I'm stuck! I am trying to use PHP variables accessed from an external file in javascript code. I can set the array from the external file. I can get PHP variables to javascript. I can get PHP array variables to javascript. Something goes wrong when ...more

   03-Dec-2009    Reply         

Small PHP Board    Small PHP Board (0) (2) Guestbook Script (Using Flat Files, no database)  Guestbook Script (Using Flat Files, no database)