Mr Allworthy
11-02-2003, 11:24 AM
PLEASE HELP ME WITH MY COUNTER!!!
I'm trying to make a hit counter with flash MX and PHP, but it wont work. I have done sevral tutorials, and tried to pick up information from forums, but nothing seems to work.
I would really appreciate if someone of you script guys could help me out....I've tried everything....
I've used Flash MX and PHP to make mailforms etc without having any problems, but this makes me...... ¤£##´€$£
Heres what I've done so far:
The Flash movie has uses only one frame on the main timeline which contains a movieclip(loads in the numbers of visitors) which is based on three frames with the following scripts:
Frame one:
if (startup eq "") {
startup = "Run Already";
loadVariables("counter.txt?" add random(2000), "/counter");
}
Frame two:
if (loaded == "1") {
gotoAndPlay(3);
} else {
gotoAndPlay(1);
}
Frame three:
count = Number(count) + 1;
loadVariablesNum ("counter.php?count=" + count, 0);
stop ();
While the PHP script:
<html>
<head>
<title>Counter Module For Tutorial</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<?php $fd = fopen("counter.txt", "w");
fwrite($fd, "count=".$_GET['count']."&loaded=1");
fclose($fd); ?>
<p>Counter incrimented: value is now <?php echo $_GET['count'];
</body>
</html>
And finally th Notepad text file wich contains the number of visitors:
count=0&loaded=1
Hope someone can find out whats wrong, because I can't...
I'm trying to make a hit counter with flash MX and PHP, but it wont work. I have done sevral tutorials, and tried to pick up information from forums, but nothing seems to work.
I would really appreciate if someone of you script guys could help me out....I've tried everything....
I've used Flash MX and PHP to make mailforms etc without having any problems, but this makes me...... ¤£##´€$£
Heres what I've done so far:
The Flash movie has uses only one frame on the main timeline which contains a movieclip(loads in the numbers of visitors) which is based on three frames with the following scripts:
Frame one:
if (startup eq "") {
startup = "Run Already";
loadVariables("counter.txt?" add random(2000), "/counter");
}
Frame two:
if (loaded == "1") {
gotoAndPlay(3);
} else {
gotoAndPlay(1);
}
Frame three:
count = Number(count) + 1;
loadVariablesNum ("counter.php?count=" + count, 0);
stop ();
While the PHP script:
<html>
<head>
<title>Counter Module For Tutorial</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<?php $fd = fopen("counter.txt", "w");
fwrite($fd, "count=".$_GET['count']."&loaded=1");
fclose($fd); ?>
<p>Counter incrimented: value is now <?php echo $_GET['count'];
</body>
</html>
And finally th Notepad text file wich contains the number of visitors:
count=0&loaded=1
Hope someone can find out whats wrong, because I can't...