보내는 쪽


$url = 'http://xxxx.com';

$post['data'] = 'data';


$ch = @curl_init();


curl_setopt($ch, CURLOPT_URL,$url);

curl_setopt($ch, CURLOPT_POST, true);  

 curl_setopt($ch, CURLOPT_POSTFIELDS, $post);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$res = curl_exec ($ch);


curl_close ($ch); // Close cURL handle


ver_dump($res);

 




받는 쪽


if($_POST['data']){

echo 'Success : '.$_POST['data'];

}else{

echo 'Fail';

}

 








[문의하기]



copyright ⓒ 2018. 워크식스

+ Recent posts