Ask a Question related to Macromedia ColdFusion, Design and Development.
-
CF_error #1
Pass XML string to a URL
I need to pass a xml string to the URL. and return I will get a XML response.
I need to pass the varible in an online form and send the result in XML to a
online http xml application.
Below is a PHP sample. How can do the same in Coldfusion? CFhttp ?
$sXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
$sXML .= "<ZipCodePing><zip>" . $zip . "</zip>";
$sXML .= "<Country>" . $country . "</Country>";
$sXML .= "<affid>" . $affid. "</affid>";
$sXML .= "<password>" . $pass. "</password></ZipCodePing>";
$fp = fsockopen($url, $port, $errno, $errstr, 30);
if(!$fp) {
echo "$errstr ($errno)\n"; //tell us error
} else {
//send the server request
fputs($fp, "POST " . $path . " HTTP/1.1\r\n");
fputs($fp, "Host: " . $url . "\r\n");
fputs($fp, "Content-type: application/xml\r\n");
fputs($fp, "Content-length: " . strlen($sXML) . "\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $sXML);
$getit = "";
while(!feof($fp)) { // get the response
$getit = $getit . fgets($fp, 4096);
}
fclose($fp);
echo $getit; // displays the response
}
?>
Thanks in advance...
CF_error Guest
-
Why can I pass a string, but not a date?
I have this custom component that at the moment just repeats the passed in value. It works if I pass in a string, but if I pass the date I... -
& in a string to pass through url param
I am trying to add a list/menu in DW2004, and for each option I need to pass url paramerters the problem I am having is concantinating & in a string... -
How to pass <br> string to webservice ?
Greetings, I have asp.net page with a textbox. This textbox is used to pass values(mainly strings) to VB.NET webservice using... -
Pass String Variable from Flash MX to Director MX
Is there any way for me to pass a string variable from Flash MX to Director MX? The line of code I'm using in Flash where I'd like to pass the... -
Using query string to pass a value to a stored procedure parameter
All, I want to push on a form button in an HTML page and pass a query string to the ASP.NET page I’m opening. That query string has the... -
USA Jon #2
Re: Pass XML string to a URL
Just curious if you were able to convert your PHP to CF. I am looking at doing a similar thing.
J.
USA Jon Guest



Reply With Quote

