# Send Variable from Flash to Php Script not working

**URL:** <https://forum.kirupa.com/t/send-variable-from-flash-to-php-script-not-working/302895>\
**Category:** Uncategorized\
**Created:** [January 9, 2010, 2:53pm UTC](https://forum.kirupa.com/t/send-variable-from-flash-to-php-script-not-working/302895 "2010-01-09T14:53:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oddball](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oddball](https://forum.kirupa.com/u/oddball)\
**Post date:** [January 9, 2010, 2:53pm UTC](https://forum.kirupa.com/t/send-variable-from-flash-to-php-script-not-working/302895/1 "2010-01-09T14:53:06Z")

</div>

Hey

I am struggling with sending some variables to a php page from my flash movie. On the last frame of my flash movie i have a button which navigates the user onto a new php page where i want to display the variables in. The code i currently have is :

AS3 -

```auto

// set variables as a string containing the dynamic textfield.
var Introduction:String = (introduction_txt.text);
//
var Choices:String = (summary_txt.text);
//

//// Send Variable to php.
var requestVar:URLRequest = new URLRequest ("new-page.php");
request.method = URLRequestMethod.POST;
                
var variables:URLVariables = new URLVariables();
                
variables.Intro = "Introduction";
variables.Choices = "Choices";            
request.data = variables;
                
var loaderVar:URLLoader = new URLLoader (request);
loaderVar.addEventListener(Event.COMPLETE, onComplete);
loaderVar.dataFormat = URLLoaderDataFormat.VARIABLES;
loaderVar.load(request);
                    
function onComplete (event:Event):void{
status_txt.text = event.target.data;
}

```

PHP code on new page -

```auto

<?php

$intro = $_POST['Intro'];
$choice = $_POST['Choices'];

echo "Intro=" . $intro;

?>

```

The echo in the php page comes up as Intro=,  
I need to echo the variable of $intro which contains the dynamic text in ‘introduction\_txt.text’ in flash.

If anyone can help me out on this one??

Many Thanks

Jon
