...

View Full Version : Translater ASP code to PHP



BenyPooh
06-10-2007, 01:13 AM
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
-----------------------------------------------------------------

mr e
06-10-2007, 01:38 AM
Have you tried anything yourself?

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

BenyPooh
06-11-2007, 01:22 AM
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 :(



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum