# AS3/PHP Woes

**URL:** <https://forum.kirupa.com/t/as3-php-woes/305313>\
**Category:** flash\
**Created:** [February 23, 2010, 12:32pm UTC](https://forum.kirupa.com/t/as3-php-woes/305313 "2010-02-23T12:32:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Signy](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@Signy](https://forum.kirupa.com/u/Signy)\
**Post date:** [February 23, 2010, 12:32pm UTC](https://forum.kirupa.com/t/as3-php-woes/305313/1 "2010-02-23T12:32:51Z")

</div>

Hi all,

I’ve been searching far and wide for solid documentation on loading variables from a php file into as3. Although I’ve found a few bits and bobs I’ve not manage to come up with anything that works yet.

PHP

```auto
<?php
$galleryIdent=$_POST['galleryOne'];

echo "galleryIdent=".$galleryIdent;  
?>

```

AS3

```auto
private var phpVariables:URLVariables;
private var phpRequest:URLRequest;
private var phpLoader:URLLoader;

private function loadPHP():void
{
            phpVariables = new URLVariables();
            
            phpRequest = new URLRequest("galleryPHP/galleryPHP.php");
            phpRequest.data = phpVariables;
            phpRequest.method = URLRequestMethod.POST;
            
            phpLoader = new URLLoader();
            phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
            phpLoader.load(phpRequest);
            
            phpLoader.addEventListener(Event.COMPLETE, phpLoadingComplete);
            phpLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorListener);
}
private function phpLoadingComplete(e:Event):void
{
            trace(e.target.data.galleryIdent); 
}

```

Now the trace gives me:

```auto
%3C%3Fphp%0D%0A%24galleryIdent=%24%5FPOST%5B%27galleryOne%27%5D%3B%0D%0A%0D%0Aecho%20%22galleryIdent%3D%22%2E%24galleryIdent%3B%20%20%0D%0A%3F%3E

```

So it’s clearly communicating I’ve just go no idea how to turn that into the galleryIdent string I need.

Any suggestions?

Thanks in advance

Sigs
