Hi all,
Can any one help me regarding how to do a put an file in php using curl?
i posted a file using the following code:
<?php
$data="<root>
<name>test</name>
<Description>foo</Description>
<Created_User>abc</Created_User>
</root>";
$ch = curl_init();
$url = "some url";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_exec($ch);
curl_close($ch);
?>
it get posted. Now i want to modify the <name> to 'xyz' from 'test'. How can i do that on that url?
Thanks & Regards
Balakrishna
How to do a http put using php curl?
Moderator: General Moderators
-
balakrishnach
- Forum Newbie
- Posts: 1
- Joined: Mon Jul 06, 2009 12:30 am
Re: How to do a http put using php curl?
You will need to pass a variable. Instead of using the entire string, break it where it says "test" and instead put in a variable like $data1.