Page 1 of 1

xml transfer

Posted: Mon Jun 14, 2004 10:18 am
by mudkicker
anyone have any idea how to send xml data to an url?

Posted: Mon Jun 14, 2004 10:46 am
by Buddha443556
from http://www.php.net/curl by mmm at turkmenweb dot com:

Code: Select all

<?php 
$XPost = "<XMLcontent>sameas above</XMLcontent>" 
$url = "..same URL as above.."; 
$ch = curl_init();    // initialize curl handle 
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to 
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable 
curl_setopt($ch, CURLOPT_TIMEOUT, 4); // times out after 4s 
curl_setopt($ch, CURLOPT_POSTFIELDS, $XPost); // add POST fields 
$result = curl_exec($ch); // run the whole process 
echo $result; //contains response from server 
?>
Looks like you put in a post.

Posted: Mon Jun 14, 2004 3:50 pm
by timvw
Don't know exactly what you are looking for, but i think http://pear.php.net/packages.php?catpid ... b+Services might be usefull