Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Php Hit Counter, record your visitors...
cragllo
post Dec 6 2004, 04:31 PM
Post #1


Sorry for not being active, Uni :(
*********

Group: Members
Posts: 933
Joined: 24-August 04
From: South Wales, UK
Member No.: 892



All you do is copy this code into the page you want to display it on.

CODE
<?php
$counterfile = "counter.txt";
$counter = file("$counterfile");
$c = $counter[0];
if (strlen($c) == 0)
{$c=0;}
$c=$c+1;
$a = fopen("$counterfile", "w");
fwrite($a, $counter = "");
fputs($a, $c);
fclose($a);
echo ("$c");
?>

Make a file called 'counter.txt' in the same directory as the page the code is on.
Remember to CHMOD your txt file to 666. (change the permissions to 666)
Go to the top of the page
 
+Quote Post
predrag022
post Dec 15 2004, 05:13 PM
Post #2


Newbie
*

Group: Members
Posts: 9
Joined: 15-December 04
Member No.: 2,732



Veri Tnx biggrin.gif biggrin.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Does any one have a php counter script?(15)
  2. Visitors Counter(4)
  3. Visitors Online(9)
  4. Hit Counter(0)
  5. Php Counter(3)
  6. <?php ?> Unique Visitors Script(2)


 



- Lo-Fi Version Time is now: 7th September 2008 - 01:30 PM