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:
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:
<?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:
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
- GLOBALS: why does $GLOBALS[‘HTTP_RAW_POST_DATA’] return empty string?
- file_get_contents: how can i trace values of properties var1 and var2 inside PHP?
- POST: how can i trace values of that Array datatype inside PHP ?
You see, this is simple problem, and i am complete llama with PHP
Thank You so much for Your time…