时时商务社区

标题: php curl模拟post提交数据示例 [打印本页]

作者: bewin83    时间: 2018-2-14 06:01

            [U]复制代码[/U] 代码如下:
$url = 'http://127.0.0.1' ;
$header = array("Host:127.0.0.1",
  "Content-Type:application/x-www-form-urlencoded",
  'Referer:http://127.0.0.1/toolindex.xhtml',
  'User-Agent: Mozilla/4.0 (compatible; MSIE .0; Windows NT 6.1; Trident/4.0; SLCC2;)');
$data = 'tools_id=1&env=gamma';
echo "argvdata
";
$ret = curl_post($header, $data,$url);
$utf8 = iconv('GB2312', 'UTF-8//IGNORE', $ret);
echo 'return:
'.nl2br($utf8 ).'
';
?>
            
            
您可能感兴趣的文章:
  • php的curl实现get和post的代码
  • PHP的cURL库功能简介 抓取网页、POST数据及其他
  • PHP中使用cURL实现Get和Post请求的方法
  • PHP中CURL的CURLOPT_POSTFIELDS参数使用细节
  • PHP函数分享之curl方式取得数据、模拟登陆、POST数据
  • PHP基于CURL进行POST数据上传实例
  • php curl模拟post请求和提交多维数组的示例代码
  • PHP使用curl模拟post上传及接收文件的方法
  • php使用CURL模拟GET与POST向微信接口提交及获取数据的方法
  • PHP基于curl post实现发送url及相关中文乱码问题解决方法
            




    欢迎光临 时时商务社区 (http://bbs.4435.cn/) Powered by Discuz! X3.2