I seem to be having some trouble setting up a visitor counter on my website. I saw the tutorial by Syko for setting up a counter, I followed his instructions completely but the counter just sits at 1 and does not advance no matter how many times you refresh. The php file doesn’t seem to be saving the new number to the txt file. Can anyone help me out? You can see what I’m talking about on the opening page of my website www.bryancrabtree.com
counter.php script:
<?php
//Reading the file
$count = file_get_contents(“count.txt”);
//Increasing the count
$count = explode("=", $count);
$count[1] = $count[1]+1;
//Writing to file
$file = fopen(“count.txt”, “w+”);
fwrite($file, “count=”.$count[1]);
fclose($file);
//Returning the count
print “count=”.$count[1];
?>
count.txt Contents:
count=0
AS in flash:
this.loadVariables(“counter.php?num=”+random(99));
thanks
Bryan