Im trying to get a grip on Flash AS (client-side) and PHP (server-side) interaction.
This Flash ActionScript is supposed to send a variable (myData.ClanName) found in a textbox (TXTBOX_TESTING) to a PHP-script (when a button is pushed):
on(press){
myData = new LoadVars();
myData.ClanName = TXTBOX_TESTING;
myData.send(“http://members.lycos.co.uk/usnswe/contact/contact.php”);
}
Then this PHP-script is supposed to add this varible to a textfile (contact.txt):
<?php
$FileName = “contact.txt”;
$FilePointer = fopen($FileName, “a”);
fwrite($FilePointer, $ClanName); // Dubious Variable
fclose($FilePointer);
?>
Well, I know the PHP-script works, as Ive tried to put plaintext into the “fwrite”-functions second parameter instead of the “$ClanName”-parameter.
That will create/open “contact.txt” and add a line to it.
The problem with Flash AS is:
a) It doesnt seem to call the PHP-script when the button is pushed.
b) I dont know the correct syntax to translate the myData.ClanName - variable (sent from the AS) to a variable that the PHP-script can read.
Above Ive tried “$ClanName” (PHP: 4th line), but that doesnt seem to work.
Any suggestions?