Sending JSON from AS3 to PHP

ketepeng

New Member
I really can't figure out what's wrong.Im sending JSON from AS3 to PHP:\[code\]var sendToPHPJson:String = com.adobe.serialization.json.JSON.encode(sqlResult);myRequest = new URLRequest("http://sqn.nazwa.pl/FlashFiles/Winebook/uploadToServer.php");myLoader = new URLLoader;myVariables = new URLVariables;myVariables.firstProperty = sendToPHPJson; myLoader.addEventListener(flash.events.Event.COMPLETE,onUploadingComplete);myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;myRequest.method = URLRequestMethod.POST;myRequest.data = http://stackoverflow.com/questions/15900702/sendToPHPJson;myLoader.load(myRequest);\[/code\]And my PHP is receiving:\[code\]<?phpinclude "XXX.php";$json=$_POST['firstProperty'];$data = http://stackoverflow.com/questions/15900702/json_decode($json);$answe=$data[0]->wineName;echo"answer='".$answe."'";?>\[/code\]And i receive answer=''. But when I hardcore sendToPHPJson into PHP answer has good value.What can be wrong? What to change?
 
Top