# \[AS3\] send Object DataType, flash-\>PHP (simple Q)

**URL:** <https://forum.kirupa.com/t/as3-send-object-datatype-flash-php-simple-q/210272>\
**Category:** flash\
**Created:** [December 17, 2006, 1:11am UTC](https://forum.kirupa.com/t/as3-send-object-datatype-flash-php-simple-q/210272 "2006-12-17T01:11:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![watcher](https://avatars.discourse-cdn.com/v4/letter/w/77aa72/32.png) [@watcher](https://forum.kirupa.com/u/watcher)\
**Post date:** [December 17, 2006, 1:11am UTC](https://forum.kirupa.com/t/as3-send-object-datatype-flash-php-simple-q/210272/1 "2006-12-17T01:11:39Z")

</div>

Hi people,

**simple question**  
How can i get the property values from an Object datatype in PHP?

**situation: AS3.0 example**  
Using AS3.0 i am sending to PHP two variables inside an Object like this:

```auto

var var1:int = Math.floor( Math.random( ) * 100 );
var var2:String = "test string";
var test:Object = new Object();
     test.var1 = var1;
     test.var2 = var2;

var request:URLRequest = new URLRequest( " **path_to_php_file**" );
     request.data = test;
     request.method = URLRequestMethod.POST;

var loader:URLLoader = new URLLoader( );
     loader.addEventListener( Event.COMPLETE, [COLOR=Red] **handleResponse** [/COLOR]);
     loader.load( request );

```

**situation: PHP example**  
**path\_to\_php\_file** points to PHP file called from flash, its content looks like this:

```auto

<?php
$glob = $GLOBALS['HTTP_RAW_POST_DATA'];
$fgc = file_get_contents("php://input");

echo "GLOBALS:__" . $glob .
     "
file_get_contents:__" . $fgc .
     "
POST:__" . $_POST;
?>

```

The result is traced in flash (function \*\*[COLOR=Red]handleResponse[/COLOR] \*\*), and it traces:

```auto

GLOBALS:__
file_get_contents:__**[COLOR=Navy][object Object][/COLOR]**
POST:__[COLOR=Navy] **Array** [/COLOR]

```

**i also tried… (not working)**  
echo $fgc-\>var1 // returns empty string  
echo $fgc[‘var1’] // returns left bracket --\> **[** (lol…)  
echo $\_POST[0] // returns empty string

**my questions**

1. **GLOBALS** : why does $GLOBALS[‘HTTP\_RAW\_POST\_DATA’] return empty string?
2. **file\_get\_contents** : how can i trace values of properties var1 and var2 inside PHP?
3. **POST** : how can i trace values of that Array datatype inside PHP ?

You see, this is simple problem, and i am complete [llama](http://en.wikipedia.org/wiki/Llama)with PHP 🙂  
Thank You so much for Your time…
