|
本机:
[U]复制代码[/U] 代码如下:
'tanteng'
// 'password' => 'password'
);
$ch = curl_init ();
// print_r($ch);
curl_setopt ( $ch, CURLOPT_URL, $uri );
curl_setopt ( $ch, CURLOPT_POST, 1 );
curl_setopt ( $ch, CURLOPT_HEADER, 0 );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $data );
$return = curl_exec ( $ch );
curl_close ( $ch );
print_r($return);
远程服务器:
[U]复制代码[/U] 代码如下:
您可能感兴趣的文章:php的curl实现get和post的代码PHP CURL模拟GET及POST函数代码PHP的cURL库功能简介 抓取网页、POST数据及其他php中使用Curl、socket、file_get_contents三种方法POST提交数据PHP下使用CURL方式POST数据至API接口的代码PHP中使用cURL实现Get和Post请求的方法php curl模拟post提交数据示例php curl post 时出现的问题解决PHP函数分享之curl方式取得数据、模拟登陆、POST数据PHP基于CURL进行POST数据上传实例php curl模拟post请求和提交多维数组的示例代码PHP使用curl模拟post上传及接收文件的方法
|
|