![]() |
URLLoader using POST fails to send variables
hopefully this is simple and I'm just missing something obvious. I'm trying to hit a php page using POST data and load the response. what actually happens is the php page is hit using POST but without data. if I navigateToURL with the URLRequest instead of URLLoader.load, the data is sent.
Code:
import flash.events.*; |
I don't see anything wrong with your code unless I'm missing something... what does your php look like, is it set to grab the vars _POST or _GET?
|
thanks for your reply creatify! the php isn't doing anything other than
PHP Code:
|
sorry! I'd been misdiagnosing a problem. I'd been watching the requests and responses using firebug (and firebug lied!). the code had been working correctly all along. I only figured it out after trying to build an example that traced out the response w/o firebug. thanks for your help!
|
Hi, pseudobiotic
i use so: var sendData="param1=xxx.xx¶m2=yyyy...yy" var variables:URLVariables = new URLVariables(sendData); var request:URLRequest = new URLRequest(); request.url = "web.com"; request.method = URLRequestMethod.POST; request.data = variables; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.VARIABLES; loader.addEventListener(Event.COMPLETE, function(evt:Event):void { completeHandler(evt, clik.target)}); |
cool! thanks for your reply SarK0Y
|
pseudobiotic - I have this exact problem - all POST data is empty when I replay the request in Live HTTp Headers (firefox add-on) the POStT array is empty?? although I can see POST data in the header???
navigateToURL() - posts the data just fine and this is really baffling me ActionScript Code:
can anyone help? cheers |
the solution to my problem was that 'replaying' the request from flash in 'http live headers' and 'tamper data' add-ons for firefox didnt not replay them as flash had sent them and caused problems reading the POST data in php.
I hope that helps others! |
| All times are GMT. The time now is 02:32 PM. |
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger