Hi,
im trying get flash data into php. I have tried some turtorials on this site, and doesnt get them to work. This simple one for example flash here
I have flash mx2004 pro (trial), wamp -who consist of Apache, mysql and php5.
I’m currently working on this code(taken from another turtorial): Flash -
submit_btn.onPress = function () {
var sendlv:LoadVars = new LoadVars ();
sendlv.navn = navn_txt.text;
sendlv.alder = alder_txt.text;
sendlv.send("skrivtilfil.php", _blank, "POST");
navn_txt.text = "";
alder_txt.text = "";
}
With 2 input text fields and 1 button.
php -
<?
$navn = $_REQUEST[‘navn’];
$alder = $_REQUEST[‘alder’];
$file = “yes.txt”;
$fp = fopen($file, “a+”);
$data = fread($fp, 80000);
ftruncate($fp, 0);
$new = $navn . “.:-:.” . $alder . “.:-:.” . $data;
fwrite($fp, $new);
fclose($fp);
print “&navn=” . $new;
?>
This wont work either. I have tried with $_POST and $HTTP_POST_VARS too.
There might be some wrong with how I try test it? I publish and run the swf file, then open the skrivtilfil.php through wamp, on adr http://localhost/skole/skrivtilfil.php iow on my local apache server.
Any help would be appreciated.
Arodin