Quote:
From Thread :http://flashmove.com/board/showthrea...1185#post31185
o yeah dv8 one more request what does the "&" do?? and how come you made it like this when you load it something.userName and the php to &userName=$userName and one more question how do i use flash to send vers to php so it can record it to a txt file since i dunno db files... i'm quite new to this php only been doing it for like a week now so if you find some spare time reply dv8 thanx
-- f5inter
|

PHP Code:
<?php
// Fig 1.1
$myVar = "FlashMove";
echo "&myVar=$myVar"; // Output "&myVar=FlashMove"
?>
In the Fig.1.1, line 2 shows an "&" character. The "&" is an operator to show seperation in variables for the Interpreter. It is not necessary for the first and/or only variable being loaded to the Interpreter, but it is good practice too use.
Once the variables are loaded to the Interpreter and parsed for seperation... the "&" is then ignored.
Let's use a HitCounter as good start on how we can load and send data to and from a Text File.

PHP Code:
/* Hit Count Script- hit_count.php*/
function count_hit () {
// Read File
$file = "temp.txt";
$fp = fopen($file, "r");
$reading = fread($fp,2000);
fclose($fp);
// Increment
$reading++;
echo "&hitcount=$reading";
// Write File
$fp = fopen($file, "w");
$writeing = fwrite($fp,$reading);
fclose($fp);
}
switch ($action) {
case "countHit":
count_hit();
break;
default:
die();
break;
}

Actionscript:
hitCountVar = new LoadVars();
with(hitCountVar) {
action = "countHit";
sendAndLoad("hit_count.php", hitCountVar, "GET")
}
hitCountVar.onLoad = function () {
trace(this.hitcount); // PHP Response
}
.. to be continue