Deprecated: Function set_magic_quotes_runtime() is deprecated in /nfs/c01/h05/mnt/2939/domains/ on line 14
Cidamon: Blog: Simple use of CURL
Simple use of CURL
05 January, 2009

Here is a very simple structure of how to use curl with post method –

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);	
curl_setopt($ch, CURLOPT_POST , 1);// setting up to use post method
curl_setopt($ch, CURLOPT_POSTFIELDS, array("fieldName1"=>"data1","fieldName2"=>"data2"));							
$content = curl_exec($ch);


Commenting is closed for this article.