as3 code:
public function exists(uid:String):void {
request = new URLRequest("http://localhost/index.php");
request.method = URLRequestMethod.POST;
variables = new URLVariables();
variables.uid = uid;
request.data = variables;
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, urlLoader_existsHandler);
loader.load(request);
}
protected function urlLoader_existsHandler(event:Event):void {
trace(event);
//var variables:URLVariables = URLLoader(event.target).data;
//trace(variables);
//trace(variables.success);
}
PHP output is
success=1®istration_id=1
Error is:
Use the TEXT format instead of VARIABLES
loader.dataFormat = URLLoaderDataFormat.TEXT;
Here are the relating docs:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.