note 79399 added to ref.curl
| From: | bombicz dot zoli at gmail dot com | Date: | Sun, 25 Nov 2007 10:54:15 +0000 |
| Subject: | note 79399 added to ref.curl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132554@lists.php.net to get a copy of this message | ||
Hi all!
At first sorry for my english, i am an hungarian developer. I want to create a curl function, what
sends xml data to another server. Both servers uses https connections. At "receivers"
server I can read data only with
$request = file_get_contents('php://input');
but I don't know how to send data into php://input . I have the following code on the
"senders" server:
$_url = 'https://...url...';
$XPost = "<message request=\"location\">
<content>
....data....
</content>
</message>";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_URL,$_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_USERAGENT, $defined_vars['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $XPost);
$result=curl_exec ($ch);
curl_close ($ch);
echo("Output: ".$result);
but this code don't write xml string into php://input.
----
Server IP: 213.249.64.162
Probable Submitter: 217.145.199.34
----
Manual Page -- http://www.php.net/manual/en/ref.curl.php
Edit -- https://master.php.net/note/edit/79399
Del: integrated -- https://master.php.net/note/delete/79399/integrated
Del: useless -- https://master.php.net/note/delete/79399/useless
Del: bad code -- https://master.php.net/note/delete/79399/bad+code
Del: spam -- https://master.php.net/note/delete/79399/spam
Del: non-english -- https://master.php.net/note/delete/79399/non-english
Del: in docs -- https://master.php.net/note/delete/79399/in+docs
Del: other reasons-- https://master.php.net/note/delete/79399
Reject -- https://master.php.net/note/reject/79399
Search -- https://master.php.net/manage/user-notes.php