Please help me, im confused. All seems right but the problem is, the counter shows the number from the textfile, but the counter does not increment every visit.
did you look into the counter.txt file? is there the correct number, or does your php not update the counter?
if the number is correct there's the problem of cached data by the browser - so your browser always shows the content of the cached counter.txt and not the newest version - to work around that:
loadVariables ("counter.txt?dummy=" + random (100000), "_root.digit");
this way the browser thinks it is a "different" file and must be reloaded.
you are asking for php to update the vars
in the next frame (maybe 1/12 of a second later) you are asking for the updated text file
less than a second later you are repeating the cycle
... php on my server would not run that fast
To see whether the php works, open both the txt file and the php in browser - also the text file needs to be 666 on some servers (certainly not 755)
also, i dont think time of php processing is a factor since the flash file reloads the variable text file as a loop anyways, so it would update the counter sooner or later right?
I don't know how you run PHP on your machine, but if you use PHP 4 and apache all you have to do is tell apache to interpret php3 files like php 4 files.
add this to your httpd.conf:
AddType application/x-httpd-php .php3
Ok - are the correct values stored in the .txt file or not? if the .txt isn't updated, it can't work for flash then. can you post the contents of counter.txt and the core code of the .php3 file for writing the info to the textfile?
that's all - note that in the counter.txt there's only the current number of hits saved, nothing else. in my code php simulates the text-file by echoing the correct syntax for a flash variable file.
Yours
HTD