drl37530 2014-05-26 20:24
浏览 42

从as2到PHP的XML

I am working on some old Flash as2 application that worked fine until something happened. Most likely it's Flash 13 upgrade but I can't figure out why. PHP version on server didn't changed.

I have following function in Flash that packs XML with another function and send to printcard.php:

var xmlDoc:Object=toXML();
xmlDoc.send(_global.phpPath + "printcard.php","_blank");

printcard.php should take $_POST XML and do some work with it ...

$data = GET_POST_XML();

$xml = new XML($data);

$arrCardPage = $xml->getBranches("card", "CardPage"); 

$cardPage = $arrCardPage[0];

And really ancient GET_POST_XML() function that worked fine until recently:

global $HTTP_POST_VARS, $HTTP_RAW_POST_DATA;

if( $HTTP_RAW_POST_DATA == null || !isset($HTTP_RAW_POST_DATA) ){
    $xmldoc = '';
    reset($HTTP_POST_VARS);

    while(list($k, $v) = each($HTTP_POST_VARS)) {
    $xmldoc.=$k.'='.$v;
    };

    $xmldoc = stripslashes($xmldoc);

    $xmldoc = str_replace('<?php xml_version', '<?php xml version', $xmldoc);

    return $xmldoc;

} else {
        return $HTTP_RAW_POST_DATA;
 };

Problem is that $data is empty - I have no XML.

On phpinfo I have:

_POST["<card_id"]:
\"0\" shared=\"0\" doubleside=\"1\" BgColorPicker=\"0\" bwColors=\"1\" showBg=\"1\" name=\"\"><CardPage h=\"17.99\" w=\"46.99\"><layerFront><CardLayer bg=\"16777215\" bgImageURL=\"\"><elements><OvalElement bgAlpha=\"100\" lineAlpha=\"100\" bgColor=\"16777215\" lineColor=\"0\" lineSize=\"0.35\" useFill=\"true\" useLine=\"true\" rotation=\"0\" h=\"7.76\" w=\"22.93\" y=\"4.58\" x=\"22.57\" /></elements></CardLayer></layerFront><layerBack><CardLayer bg=\"16777215\" bgImageURL=\"\"><elements /></CardLayer></layerBack></CardPage></card>

What did I missed?

  • 写回答

2条回答 默认 最新

  • dongshuofu0039 2014-05-27 20:13
    关注

    OK, here's update in case someone stack with same issue:

    Send command is deprecated from Flash version 13. It doesn't send RAW POST DATA anymore.

    However, SendAndLoad still works fine.

    Couldn't find anything on Google or official Adobe release notes about this.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于大棚监测的pcb板设计
  • ¥20 sim800c模块 at指令及平台
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计