bulletz
12-09-2003, 01:18 AM
hello:
how can i get data using PHP and the resulting output is XML? (output is buffered)
this is the code i have in ASP
dim xmlhttp
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST","http://www.domainname.com/interface.jsp?", false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send datatosend
Set xml = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.3.0")
xml.async = false
xml.loadXml(xmlhttp.responseText)
Set xsl = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.3.0")
xsl.async = false
xsl.load (Server.MapPath("hotavail.xsl"))
Set template = Server.CreateObject("MSXML2.XSLTemplate")
template.stylesheet = xsl
set processor = template.createProcessor()
processor.input = xml
If usersession <> "" Then
processor.addParameter "usersession", usersession
End If
If firstname <> "" Then
processor.addParameter "firstname", firstname
End If
If lastname <> "" Then
processor.addParameter "lastname", lastname
End If
status = Request.Form("status")
If status <> "" Then
processor.addParameter "status", status
End If
city = Request.Form("city")
If city <> "" Then
processor.addParameter "citysearch", city
End If
state = Request.Form("stateProvince")
If state <> "" Then
processor.addParameter "statesearch", state
End If
country = Request.Form("country")
If country <> "" Then
processor.addParameter "country", country
End If
children = Request.Form("children")
If children <> "" Then
processor.addParameter "children", children
End If
processor.transform()
Response.Write (processor.output)
Set xsl = Nothing
Set xml = Nothing
Set xmlhttp = Nothing
Set template = Nothing
i need to get a PHP version of the above code, our hosting package doesnt support asp.
thanks alot and god bless!
how can i get data using PHP and the resulting output is XML? (output is buffered)
this is the code i have in ASP
dim xmlhttp
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST","http://www.domainname.com/interface.jsp?", false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send datatosend
Set xml = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.3.0")
xml.async = false
xml.loadXml(xmlhttp.responseText)
Set xsl = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.3.0")
xsl.async = false
xsl.load (Server.MapPath("hotavail.xsl"))
Set template = Server.CreateObject("MSXML2.XSLTemplate")
template.stylesheet = xsl
set processor = template.createProcessor()
processor.input = xml
If usersession <> "" Then
processor.addParameter "usersession", usersession
End If
If firstname <> "" Then
processor.addParameter "firstname", firstname
End If
If lastname <> "" Then
processor.addParameter "lastname", lastname
End If
status = Request.Form("status")
If status <> "" Then
processor.addParameter "status", status
End If
city = Request.Form("city")
If city <> "" Then
processor.addParameter "citysearch", city
End If
state = Request.Form("stateProvince")
If state <> "" Then
processor.addParameter "statesearch", state
End If
country = Request.Form("country")
If country <> "" Then
processor.addParameter "country", country
End If
children = Request.Form("children")
If children <> "" Then
processor.addParameter "children", children
End If
processor.transform()
Response.Write (processor.output)
Set xsl = Nothing
Set xml = Nothing
Set xmlhttp = Nothing
Set template = Nothing
i need to get a PHP version of the above code, our hosting package doesnt support asp.
thanks alot and god bless!