# Sending flash data to php

**URL:** <https://forum.kirupa.com/t/sending-flash-data-to-php/145675>\
**Category:** Uncategorized\
**Created:** [April 24, 2005, 9:37pm UTC](https://forum.kirupa.com/t/sending-flash-data-to-php/145675 "2005-04-24T21:37:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arodin](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Arodin](https://forum.kirupa.com/u/Arodin)\
**Post date:** [April 24, 2005, 9:37pm UTC](https://forum.kirupa.com/t/sending-flash-data-to-php/145675/1 "2005-04-24T21:37:57Z")

</div>

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](http://www.kirupa.com/developer/actionscript/displayinphp.htm)

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](http://localhost/skole/skrivtilfil.php) iow on my local apache server.

Any help would be appreciated.

Arodin
