# Passing vars from Flash to HTML

**URL:** <https://forum.kirupa.com/t/passing-vars-from-flash-to-html/45153>\
**Category:** programming\
**Created:** [March 11, 2004, 2:40pm UTC](https://forum.kirupa.com/t/passing-vars-from-flash-to-html/45153 "2004-03-11T14:40:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![choja78](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@choja78](https://forum.kirupa.com/u/choja78)\
**Post date:** [March 11, 2004, 2:40pm UTC](https://forum.kirupa.com/t/passing-vars-from-flash-to-html/45153/1 "2004-03-11T14:40:09Z")

</div>

I there. I seem to be having some problems passing variable from Flash to HTML.

In my movie I simply havea variable text box named ‘value’ and a button. The user types in some text and then when pressing the button it passes that variable to a new HTML page. The problem I’m having is the PHP part.

So again I’m passing the varilabe ‘value’.

I then send the variable using getURL:

//send variable  
on (release){  
getURL(‘[http://localhost/middle.php4’,\_blank,'GET](http://localhost/middle.php4',_blank,'GET)’);  
}

The middle.php4 conatins the following code  
\<title\> Passing the Variable \<? echo $value ?\>\</title\>

…and in the body contains a line:  
The variable you should see is \<? echo $value ?\>

When looking this in the browser the \<title\> just prints it exactly has shown '\<? echo $value ?\>

where as the second line doesn’t show the value at all (i.e. The variable you should see is _blank_)

I tried adding the line $value = $\_POST[‘value’] but that didn’t work.

Any other thoughts? Could there be something wrong with my PHP? I’m running on 4.3

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 11, 2004, 2:43pm UTC](https://forum.kirupa.com/t/passing-vars-from-flash-to-html/45153/2 "2004-03-11T14:43:11Z")

</div>

why are you naming your files .php4, just name them .php

try using

```php
<? echo $_GET['value'] ?>

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 11, 2004, 2:50pm UTC](https://forum.kirupa.com/t/passing-vars-from-flash-to-html/45153/3 "2004-03-11T14:50:14Z")

</div>

Thanks for the reply. I tried the $\_GET[‘value’]; and am still having the same issue.

The reason why I’m using php4 is because I have a program (Microsoft Picture IT) that uses the same extension. Whenever I try to edit my php files it alway opens it with Picture IT.

Is there any harm using the extension .php4?

Thanks again

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 11, 2004, 2:54pm UTC](https://forum.kirupa.com/t/passing-vars-from-flash-to-html/45153/4 "2004-03-11T14:54:50Z")

</div>

only the fact that PHP might not recognize them as PHP files. And in that case they won’t get parsed as PHP files, unless you change the default extentions in the apache confd.http file…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 11, 2004, 3:28pm UTC](https://forum.kirupa.com/t/passing-vars-from-flash-to-html/45153/5 "2004-03-11T15:28:40Z")

</div>

yeah, I changed the default in the httpd.conf already to include .php4.

Right now my php files are working when talking to mySQL but I have no idea why it’s not working when echo’ing.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 11, 2004, 4:23pm UTC](https://forum.kirupa.com/t/passing-vars-from-flash-to-html/45153/6 "2004-03-11T16:23:46Z")

</div>

shouldn’t you be using something like this to send a value to a php page from flash?  
[AS]MYbutton.onRelease = function() { //This is your submit button, change instance name to match.  
buttonVars = new LoadVars();  
buttonVars.value = your\_var\_to\_be\_sent; //use a textbox instance name, or a variable here.  
buttonVars.send(“[http://yoursite.com/value.php](http://yoursite.com/value.php)”, “\_blank”, “POST”);  
};[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 11, 2004, 6:33pm UTC](https://forum.kirupa.com/t/passing-vars-from-flash-to-html/45153/7 "2004-03-11T18:33:48Z")

</div>

It wokred!

I changed the httpd.conf back to it’s default and removed Picture IT and it’s now working witht he .php extension.

Thanks for all your helps guys.

:azn:
