it just sends some xml data to another page.
Code: Select all
<%
stop
dim strURL, strContent
dim xmlhttp
dim oXMLCriteria
Dim xmlPlainString
xmlPlainString = "<search><city>75</city><age>21</age></search>"
'page to http post to
strURL="http://www.examplesite.com/results_xml.aspx"
set xmlhttp=Server.CreateObject("Microsoft.XMLHTTP")
call xmlhttp.Open("POST", strURL, false)
on error resume next
call xmlhttp.Send(xmlPlainString)
if err.number <> 0 then
strContent = err.Description
else
strContent = xmlhttp.responseText
end if
dim oXML
'load xml property results into xml and do whatever formatting is necessary.
set oXML = server.CreateObject("msxml.domdocument")
oXML.loadXML(strContent)
Response.Clear()
Response.ContentType = "text/xml"
oXML.save response
response.end
%>Any help would be very much appreciated.
Heres what I've tried so far:
Code: Select all
$url = 'http://www.examplesite.com/results_xml.aspx';
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 9);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "".urlencode("<search><city>75</city><age>21</age></search>"));
curl_setopt ($ch, CURLOPT_POST, 1);
echo $result2 = curl_exec ($ch);
curl_close($ch);