# PHP/Flash hit counter error

**URL:** <https://forum.kirupa.com/t/php-flash-hit-counter-error/179004>\
**Category:** programming\
**Created:** [February 16, 2006, 12:15am UTC](https://forum.kirupa.com/t/php-flash-hit-counter-error/179004 "2006-02-16T00:15:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![evynco](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/evynco/32/2159_2.png) [@evynco](https://forum.kirupa.com/u/evynco)\
**Post date:** [February 16, 2006, 12:15am UTC](https://forum.kirupa.com/t/php-flash-hit-counter-error/179004/1 "2006-02-16T00:15:50Z")

</div>

I’m on day 2 of trying to get this to work…:crying:  
I followed the tutorial here and have:

[COLOR=blue][COLOR=red]count.txt[/COLOR] (containing count=0, permissions 777)[/COLOR]  
[COLOR=#0000ff][/COLOR]  
[COLOR=#0000ff][COLOR=red]counter.php[/COLOR] containing…[/COLOR]  
[COLOR=#0000ff]\<?php  
$count = file\_get\_contents(“count.txt”);  
$count = explode("=", $count);  
$count[1] = $count[1]+1;  
$file = fopen(“count.txt”, “w+”);  
fwrite($file, “count=”.$count[1]);  
?\>[/COLOR]  
[COLOR=#0000ff][/COLOR]  
[COLOR=black]…in the same directory on my server.[/COLOR]

In my Flash swf I have placed a dynamic text field called [COLOR=red]count[/COLOR][COLOR=black], no Instance Name. In frame 2 of my main swf I have [/COLOR][COLOR=blue]this.loadVariables(“counter.php?num=”+random(99));[/COLOR]

When I open the page I get no count, just the error [COLOR=red]\_level0.count[/COLOR]  
[COLOR=#0000ff][/COLOR]  
[COLOR=black]Did I miss something ? Does the dynamic text need to be converted to a Movie Clip ?[/COLOR]

Thanks guys.
