bluemicrobyte
11-10-2005, 7:53 PM
UPDATE: A solution has been found! The following PHP script with modifications to the flash file will display the number of unique visitors from the second script mentioned below.
<?php
$file_count = fopen('count.db', 'rb');
$data = '';
while (!feof($file_count)) $data .= fread($file_count, 4096);
fclose($file_count);
list($today, $yesterday, $total, $date, $days) = split("%", $data);
echo "c=".$total."";
?>
Is it possible to modify this script so that if $total equals to 12 the script will output c=000012 instead of c=12 so that there are at least 6 digits?
---------------------------old post-------------------------------
I found a very simple visitor counter PHP script.
Download: http://www.nweb.ch/scripts/
(click here for direct download link (http://www.nweb.ch/scripts/flash_live_counter/live_counter.zip))
UPDATE: An alternative to editing this PHP script (which people have told me will be ugly if anyone tries to do it) is to modify the flash file that displays the number of hits so that instead of getting the number from this script it gets the number from the text file of another script -- see the "PS" in the post below this. I do not know how to modify the flash file, but if you think you can please help.
I've modified the flash file to fit my site (http://bluemicrobyte.kupatrix.org/Microbyte_Productions/index.html), but currently the counter counts every time the page is refreshed. Does someone know how to edit the count.php file so that the counter only increases for each unique IP address that visits my page? (visitors returning after 24 hours would be counted as new visitors)
<?php
$file_count = fopen('count.db', 'rb');
$data = '';
while (!feof($file_count)) $data .= fread($file_count, 4096);
fclose($file_count);
list($today, $yesterday, $total, $date, $days) = split("%", $data);
echo "c=".$total."";
?>
Is it possible to modify this script so that if $total equals to 12 the script will output c=000012 instead of c=12 so that there are at least 6 digits?
---------------------------old post-------------------------------
I found a very simple visitor counter PHP script.
Download: http://www.nweb.ch/scripts/
(click here for direct download link (http://www.nweb.ch/scripts/flash_live_counter/live_counter.zip))
UPDATE: An alternative to editing this PHP script (which people have told me will be ugly if anyone tries to do it) is to modify the flash file that displays the number of hits so that instead of getting the number from this script it gets the number from the text file of another script -- see the "PS" in the post below this. I do not know how to modify the flash file, but if you think you can please help.
I've modified the flash file to fit my site (http://bluemicrobyte.kupatrix.org/Microbyte_Productions/index.html), but currently the counter counts every time the page is refreshed. Does someone know how to edit the count.php file so that the counter only increases for each unique IP address that visits my page? (visitors returning after 24 hours would be counted as new visitors)