php的post
代码的顺序不能乱,否则会提交错误
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POST,true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
if($header!='')
{
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
} if($https==true)
{
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);//当需要访问https网站的时候一定要避开证书的验证
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);//当需要访问https网站的时候一定要避开证书的验证
}
$content = curl_exec($ch);
curl_close($ch);
随机推荐
- laravel cache get 是如何调用的?
本文使用版本为laravel5.5 cache get public function cache() { $c=\Cache::get('app'); if(!$c) { \Cache::put(' ...
- JavaScript数组常用的方法
改变原数组: ※ push,pop,shif,unshift,sort,reverse ※ splice 不改变原数组: ※ concat,join→split,toString,slice push ...
- 【jQeury】input输入框状态,input事件,blur事件,focus事件
//输入框正在输入时 $("#test1").on('input',function(){ alert('正在输入'); }) //输入框得到焦点时 $("#test2& ...
- php-5.6.26源代码 - 如何用C语言支持“类似异常”机制
代码编写在文件php-\Zend\zend.h #define zend_bailout() _zend_bailout(__FILE__, __LINE__) #ifdef HAVE_SIGSETJ ...
- iOS各个版本的特点
一.导航控制器中: iOS7: 栈顶控制器默认是320*480:控制器有64的高度看不见:
- dategrip破解
https://blog.csdn.net/weixin_39428938/article/details/81078806
- [CodeForces954D]Fight Against Traffic(最短路)
Description 题目链接 Solution 从起点和终点分别做一次最短路并记录结果 枚举每一条可能的边判断 Code #include <cstdio> #include < ...
- 笔记-scrapy-cookie
笔记-scrapy-cookie传递 1. scrapy cookie传递 1.1. 开始 与cookie相关的设置参数有两个: COOKIES_ENABLED 决定是否使用cooki ...
- [工具使用]xshell 中“快速命令集”的使用
突然看到朋友的xshell比我多一个按钮,且一点,哈哈哈 ,实现了很炫酷的功能,耐不住好奇,问了一句,原来是快速命令集! 1.选择快速命令集(两种方法a&b) a:文件 > 属性 > ...
- 关于android 5.0报错:dlopen failed: couldn't map ... Permission denied
问题描述: 我的应用当中集成了一个安全相关的sdk,而这个sdk中使用的so是加过壳的. 它加载native so的方式是:Java System.loadLibrary --> native ...