bagder: curl-www/libcurl/php/examples authors.txt, 1.4, 1.5 put.php, NONE, 1.1 put.php.html, NONE, 1.1

[email protected]
Newsgroups gmane.comp.web.curl.www.cvs
Message-ID <[email protected]>
Update of /cvsroot/curl/curl-www/libcurl/php/examples
In directory labb:/tmp/cvs-serv28100

Modified Files:
	authors.txt 
Added Files:
	put.php put.php.html 
Log Message:
put.php by Julian Bond


Index: authors.txt
===================================================================
RCS file: /cvsroot/curl/curl-www/libcurl/php/examples/authors.txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- authors.txt	15 Nov 2005 13:56:27 -0000	1.4
+++ authors.txt	9 Jun 2006 07:49:46 -0000	1.5
@@ -8,3 +8,4 @@
 linkchecker.php <a title="Michael Phipps is a PHP Programmer located in Brisbane, Queensland, Australia." href="http://michaelphipps.com" >Michael Phipps</a>
 ftpupload.php Daniel Stenberg
 rss-adsense.php <a href="http://planetOzh.com">Ozh</a>
+put.php Julian Bond

--- NEW FILE: put.php ---
<?php
//
// HTTP PUT to a remote site
// Author: Julian Bond
//

$url = "http://some.server.com/put_script";
$localfile = "localfile.csv";

$fp = fopen ($localfile, "r");
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_USERPWD, 'user:password');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PUT, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_INFILE, $fp);
curl_setopt($ch, CURLOPT_INFILESIZE, filesize($localfile));

$http_result = curl_exec($ch);
$error = curl_error($ch);
$http_code = curl_getinfo($ch ,CURLINFO_HTTP_CODE);

curl_close($ch);
fclose($fp);

print $http_code;
print "<br /><br />$http_result";
if ($error) {
   print "<br /><br />$error";
}

?>

--- NEW FILE: put.php.html ---
Perform a HTTP PUT to a remote site
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.