Post Data to Remote server using curl
Using curl you can post data to remote server . You have to place all the details to send in a array .
// URL to post data
$url = "http://www.publicvoidlife.com/curl.php";
// Data to send
$data = array(
"name" => "Jijin",
"country" => "IN",
)
$postData = '';
foreach($data as $k => $v)
{
$postData .= $k.'='.$v.'&';
}
rtrim($postData, '&');
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($postData));
curl_setopt($ch,CURLOPT_POSTFIELDS, $postData);
$result = curl_exec($ch);
curl_close($ch);
The data can be fetched by GET method
For eg:
$_GET[‘name’]
Recent Comments