Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Translater ASP code to PHP

    Hi, I have an exemple of a script here in ASP that
    receives an XML document and puts it into array :

    I would really need some help to translate this into PHP script !
    Thank You very much

    -----------------------------------------------------------------
    'Get XML that was send from SWF file
    Dim sXMLString

    dim item as String
    For Each item In Request.Form
    'Response.Write(item & " = " & Request.Form(item) & VbCrLf)
    sXMLString = sXMLString & item & " = " & Request.Form(item)
    Next

    'Load XML into object
    Dim oXML as Object
    Dim oNodeList as Object
    Dim oNode as Object

    oXML = Server.CreateObject("MSXML2.DOMDocument")
    oXML.async = False
    oXML.validateOnParse = False

    'Response.Write(sXMLString)
    'Response.Write(oXML.loadXML(sXMLString))
    oXML.loadXML(sXMLString)

    'Use XPath to get the data
    dim sPath as String
    sPath = "/data/variable/row/column"
    oNodeList = oXML.documentElement.selectNodes(sPath)

    'Store data in an array
    dim i, aVals(3)
    i=0
    For Each oNode in oNodeList
    With oNode
    ' Just write the xml for that node to show you.
    'Response.Write(.text + "<br>")
    aVals(i)=.text
    i=i+1
    End With
    Next
    -----------------------------------------------------------------

  • #2
    Regular Coder
    Join Date
    Apr 2007
    Posts
    295
    Thanks
    0
    Thanked 19 Times in 19 Posts
    Have you tried anything yourself?

    I'm all for helping, but I'm not going to do the entire thing for you.

  • #3
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Allright,
    my biggest problem is the following, here's what I did :

    --------------------------------------------------
    <?php
    foreach ($_REQUEST as $field => $value){
    $i++;
    $AFIELD[$i] = $field;
    $AVALUE[$i] = $value;
    $valt = $valt.$i;
    $val = $val.$value;
    }?
    ?>
    --------------------------------------------------

    The thing is :
    I have a Flash file (SWF) that sends some data (in XML format) trough
    HTTP POST method to a given URL. (let say www.test.com/addresult.php)

    I would need my PHP script to capture the data which is suppose to look
    like this :

    --------------------------------------------------
    <data>
    <variable name="Vote">
    <row>
    <column>5.0</column>
    </row>
    </variable>
    </data>
    --------------------------------------------------

    I know how to script to send back data to the file... but I dont know
    how to capture de data sent by the SWF file...
    They give an exemple with ASP (as show above) .
    Been working around for +20 hours now. still cant get it to work


  •  

    Posting Permissions

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