当前位置:Gxlcms > PHP教程 > curl-phpcURL上传文件失败

curl-phpcURL上传文件失败

时间:2021-07-01 10:21:17 帮助过:33人阅读

phpcurl

curlPost.php

  'wyjie',        'img'  => '@D:/debug.exe'        );    //cURL发送post请求    $ch = curl_init();    curl_setopt($ch, CURLOPT_URL, 'http://localhost/demo/demo/curl/01.php');    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);    curl_setopt($ch, CURLOPT_POST, 1);    curl_setopt($ch, CURLOPT_POSTFIELDS, $post);    $optput = curl_exec($ch);    curl_close($ch);    echo $optput; ?>

01.php

 

输出结果
Array ( [name] => wyjie [img] => @./debug.exe ) Array ( )

人气教程排行