# Flash Site Counter

**URL:** https://forum.kirupa.com/t/flash-site-counter/100850
**Category:** Uncategorized
**Created:** [February 3, 2004, 7:02am UTC](https://forum.kirupa.com/t/flash-site-counter/100850 "2004-02-03T07:02:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bcrabtree](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bcrabtree](https://forum.kirupa.com/u/bcrabtree)
#### Post date: [February 3, 2004, 7:02am UTC](https://forum.kirupa.com/t/flash-site-counter/100850/1 "2004-02-03T07:02:35Z")

</div>

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](http://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
