A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Help with sending XML object from Flex to php

  1. #1
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90

    Help with sending XML object from Flex to php

    I have an XML object i need to send from Flex to php so that php can write it to a file. I am trying to send it using HTTPService:

    Code:
    <mx:HTTPService id="sendXML" url="http://localhost/php/getXML.php" contentType="application/xml" useProxy="false" method="POST">
    </mx:HTTPService>
    And my getXML.php looks like this:

    PHP Code:
    <?php

    $raw_xml  
    file_get_contents("php://input");

    $myFile "testFile.xml";
    $fh fopen($myFile'w') or die("can't open file");
    fwrite($fh$raw_xml);

    fclose($fh);

    ?>
    After i do :
    Code:
    sendXML.request = inputXML;  //inputXML is my XML object i am trying to send
    sendXML.send();
    I get the empty 'testFile.xml' file so i am obviously doing something wrong but can't figure it out what excatly Can someone please help me with this?

    thanks in advance
    Last edited by blu3; 09-27-2007 at 10:59 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center