我在 Actionscript 的 XMLList 中有值。需要将这些值发送到数据库并更新它。我的动作脚本代码如下:
public static function saveUserPermList():void {
var ht:HTTPService = new HTTPService();
ht.url = Config.getServerURL();
ht.method = URLRequestMethod.POST;
//ht.resultFormat = "e4x";
ht.contentType = "text/xml";
ht.request["action"] = "saveUserPermListXML";
ht.request["pdata"] = Application.application.userPermListModel.toString();
ht.addEventListener(ResultEvent.RESULT,AdminUserList.saveUserPermListResult);
ht.send();
}
public static function saveUserPermListResult(e:ResultEvent):void {
trace(e);
}
- 如何将 XMLList 数据发送到 PHP?我应该添加一个 toString() 吗?
- Flex中的contentType也应该是什么。
我怎样才能在 PHP 中捕捉到这个,请告诉我,尝试使用这种方式,
if($user -> isAllowedAccess()) {
header("Content-type:text/xml");
$postedData = $_POST["pdata"];
// $xmldoc = simplexml_load_string($POST['pdata']);
// echo($xmldoc);
}
没运气。请让我知道。