how it work?
first the counter run us usual, using a php script, i use my old simple text counter with litle
modification.
We got two php script to make this possible, one counting other showing, you can put it on
one file even on spreaded files.
Below this is the script that have function to add out counter;
<?
if (!$phpcounter) {
//set cookies, so our counter isnt growing, at last 1 hour
setcookie("phpcounter",lock,time()+3600);
//open out flat data counter
$file = fopen("/location/of/our/flat/data/count.txt","r+");
//read it
$count = fread($file, filesize("/location/of/our/flat/data/count.txt"));
//close the file
fclose($file);
//set variable to add 1
$count +=1;
//open again to add 1
$file = fopen("/location/of/our/flat/data/count.txt","w+");
fputs($file, $count);
fclose($file); }
?>
now we going to script that have function to show our counter let name it flacounter.php3
<?
$filename = "/home/idban/count.txt";
//open out flat data counter
$fd = fopen ($filename, "r");
//read it
$counter = fread ($fd, filesize ($filename));
//close the file
fclose ($fd);
//set variable to flacounter
$flacounter = "counter=";
//set variable flacounter as rawdata
$flacounter .= rawurlencode($counter);
//print it, you will got counter=number..
echo "$flacounter";
?>
After making that scripts, now stating to make the fla file
A. select your text, then...right klik
B. select properties
then make sure you name your text property same as variable that you had chosse on your script, we
use counter= ; so .. we name it counter
now go to action/frame, pointing to your text ( counter ) layer, as you know out layer named
guestnum, so we pick the guestnum, next step, just right klik on it
and select properties
A. select action,
B. push + simbol, ( C ) select Load Variable, fill with location of your script that showing the
counter, mine is http://php.klik.or.id/fla/flaconter.php3 so, put it on the URL ( E )
D. push + simbol, once again and add play
F. change variable to GET
Credits:
- Rasmus, Julie, Desy fatmawati,
Jakarta, 21 Agustus 2000, copyleft by idban secandri <idban@nospam.satunet.com>
sample and complete documentation available on http://php.klik.or.id/fla