xml transfer

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
mudkicker
Forum Contributor
Posts: 479
Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:

xml transfer

Post by mudkicker »

anyone have any idea how to send xml data to an url?
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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
Post Reply