# Flash and PHP Variable Issue

**URL:** <https://forum.kirupa.com/t/flash-and-php-variable-issue/305917>\
**Category:** flash\
**Created:** [March 5, 2010, 4:48pm UTC](https://forum.kirupa.com/t/flash-and-php-variable-issue/305917 "2010-03-05T16:48:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlafond82](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jlafond82](https://forum.kirupa.com/u/jlafond82)\
**Post date:** [March 5, 2010, 4:48pm UTC](https://forum.kirupa.com/t/flash-and-php-variable-issue/305917/1 "2010-03-05T16:48:57Z")

</div>

Everyone, I am at my wits end, i just cannot figure this out. All I am trying to do is declare a variable in PHP and pass that variable to my flash file. Right now i am simply trying to do 1 easy variable, more will happen in the future but i need to figure this out first.

Can someone show me how to do this simply, I have used other forums and they say try this and that, but nothing i do seems to work. here is my code.

```php

<?php 
$fname = $_POST['John'] ; 
echo '&firstName=' . $fname;
?>

```

[AS]  
var request:URLRequest = new URLRequest( “myPhp.php” );  
request.method = URLRequestMethod.POST;  
var variables:URLVariables = new URLVariables();  
variables.firstName = “Test”;  
request.data = variables;  
var loader:URLLoader = new URLLoader(request);  
loader.addEventListener( Event.COMPLETE, loadCompleteHandler);  
loader.dataFormat = URLLoaderDataFormat.VARIABLES;  
loader.load( request );

function loadCompleteHandler( event:Event ):void  
{

var data:URLVariables = new URLVariables( loader.data );  
statusTxt1.text = loader.data.firstName;  
trace( data.firstName );  
}  
[/AS]

I have no clue, please help
