# Trying to pass var from php to txt to flash

**URL:** <https://forum.kirupa.com/t/trying-to-pass-var-from-php-to-txt-to-flash/171042>\
**Category:** Uncategorized\
**Created:** [December 1, 2005, 2:18pm UTC](https://forum.kirupa.com/t/trying-to-pass-var-from-php-to-txt-to-flash/171042 "2005-12-01T14:18:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![olympiakos7](https://avatars.discourse-cdn.com/v4/letter/o/278dde/32.png) [@olympiakos7](https://forum.kirupa.com/u/olympiakos7)\
**Post date:** [December 1, 2005, 2:18pm UTC](https://forum.kirupa.com/t/trying-to-pass-var-from-php-to-txt-to-flash/171042/1 "2005-12-01T14:18:35Z")

</div>

I’m trying to pass variables from php to a text file and have it display in a swf.  
ultimately the first\_name var will come from a database.

my actionscript is as follows:

```auto

loadText = new LoadVars();
loadText.load("firstname.txt", 0,"GET");
loadText.onLoad = function() {
loadedText.text = this.first_name;
loadedText.html = true
scroller.htmlText = this.first_name;
};

```

my text file:

```auto
first_name=<?echo " id:$_GET[first_name]";?>

```

my html code:

```auto
<param name=FlashVars value="first_name=john"/>
<embed src="main.swf" FlashVars="first_name=john"/>

```

when i test my movie it should say “John” in my text field. Am I missing a php file? can the .txt file get a variable from a php file?

I hope this makes sense.

Thanks for your time.
