时间:2021-07-01 10:21:17 帮助过:26人阅读
10086, 'pic' => "@".realpath('./img_8176.jpg').";type=image/png");print_r($data);$ch = curl_init();curl_setopt($ch, CURLOPT_URL, 'http://192.168.10.103/curl/upload_server.php' );curl_setopt($ch, CURLOPT_POST, true );//curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, FALSE);//curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);//模拟浏览器动作curl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, false );curl_setopt($ch, CURLOPT_POSTFIELDS, $data);curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));//curl_setopt($ch, CURLOPT_HEADER, false);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);$return_data= curl_exec($ch);echo "";print_r($return_data);echo "";curl_close($ch);var_dump($return_data); if(@curl_errno($return_data)==0){ return json_decode($return_data,true); }else { return false; }?>
问题已经解决了
错误原因以及解决方案见文档
http://segmentfault.com/a/1190000000725185