PHP CURL实现模拟登陆并上传文件操作示例

本文实例讲述了PHP CURL实现模拟登陆并上传文件操作。分享给大家供大家参考,具体如下:

","cUrl Error:".curl_error($ch);
  }else{
    return $output;
  }
  //  释放cURL句柄
  curl_close($ch);
}
$temp = array();
$temp['title'] = iconv( "utf-8", "gb2312//IGNORE" , "牛排店加盟");
$temp['ly'] = iconv( "utf-8", "gb2312//IGNORE" , "特色餐饮加盟");
$temp['classid'] = iconv( "utf-8", "gb2312//IGNORE" , "7159");
$temp['newssort'] = iconv( "utf-8", "gb2312//IGNORE" , "1");
$temp['panduan'] = iconv( "utf-8", "gb2312//IGNORE" , "0");
$temp['submit_button'] = iconv( "utf-8", "gb2312//IGNORE" , "发布");
$temp['addr'] = iconv( "utf-8", "gb2312//IGNORE" , "bjcanyin");
$temp['ContentBg'] = "";
$temp['newss'] = iconv( "utf-8", "gb2312//IGNORE" , htmlspecialchars_decode("

阿会计师的贺卡收到框架

\"\"

", ENT_QUOTES)); $cookie_file = dirname(__FILE__)."/jdzj.tmp"; $sumbit_url = "http://***/news/***.asp"; $http_url="http://***/news/***.asp?act=addok"; $img = curl_form($temp,$http_url,$sumbit_url,$cookie_file); var_dump($img);

PS:关于PHP curl选项详细说明可参考https://www.jb51.net/article/39331.htm

更多关于PHP相关内容感兴趣的读者可查看本站专题:《php curl用法总结》、《PHP网络编程技巧总结》、《PHP数组(Array)操作技巧大全》、《php字符串(string)用法总结》、《PHP数据结构与算法教程》及《PHP中json格式数据操作技巧汇总》

希望本文所述对大家PHP程序设计有所帮助。

你可能感兴趣的:(PHP CURL实现模拟登陆并上传文件操作示例)