惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
Jina AI
Jina AI
雷峰网
雷峰网
月光博客
月光博客
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
B
Blog RSS Feed
美团技术团队
C
CXSECURITY Database RSS Feed - CXSecurity.com
小众软件
小众软件
Security Latest
Security Latest
Microsoft Azure Blog
Microsoft Azure Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
A
Arctic Wolf
Latest news
Latest news
Attack and Defense Labs
Attack and Defense Labs
I
Intezer
F
Fortinet All Blogs
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
Webroot Blog
Webroot Blog
S
Secure Thoughts
Help Net Security
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
V
Visual Studio Blog
P
Proofpoint News Feed
博客园 - 【当耐特】
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
Stack Overflow Blog
Stack Overflow Blog
Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
H
Help Net Security
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tenable Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog

追剧生活网

前端代替iframe的方法 - 追剧生活网 前端代替iframe的方法 - 追剧生活网 写领券工具时,遇到的问题 - 追剧生活网 写领券工具时,遇到的问题 - 追剧生活网 实例:php利用cURL传递post数据 - 追剧生活网 “无法启动程序,计算机丢失 MSVCP120.dll”终极解决办法 - 追剧生活网 “无法启动程序,计算机丢失 MSVCP120.dll”终极解决办法 - 追剧生活网 利用jQuery实现绑定按钮变色写法 - 追剧生活网 利用jQuery实现绑定按钮变色写法 - 追剧生活网 今天什么也不做,好好哭一场。 - 追剧生活网 今天什么也不做,好好哭一场。 - 追剧生活网 解决微信播放视频无法全屏 - 追剧生活网 解决微信播放视频无法全屏 - 追剧生活网 2020年,愿你我安康 - 追剧生活网 2020年,愿你我安康 - 追剧生活网 html5的video标签播放m3u8视频 - 追剧生活网 html5的video标签播放m3u8视频 - 追剧生活网
实例:php利用cURL传递post数据 - 追剧生活网
mengkun · 2021-06-04 · via 追剧生活网

说实话,我也不太懂。我只知道它能请求别的网站的信息,并返回响应。支持get、post请求,还能设置referer、cookie等等,具体看菜鸟教程吧:https://www.runoob.com/php/php-ref-curl.html

什么实例

有个活动,每天不定时放名额,所有我就用curl写了个页面,去监控它,放名额时给我发邮件。

直接放后端代码吧,前端就是写个ajax去请求后端。

   // 创建一个新cURL资源
   $ch = curl_init();
    // 设置URL和相应的选项
    curl_setopt($ch, CURLOPT_URL, "这里填请求的页面api");
    curl_setopt($ch, CURLOPT_HEADER, false);
    //声明使用POST方式来进行发送
    curl_setopt($ch, CURLOPT_POST, 1);
    $data12='这里填post的内容';
    //发送什么数据呢
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data12);
   //如果是get请求,就不用上面三行代码,其他都一样
    
    curl_setopt( $ch ,CURLOPT_REFERER, "这里填来源页面" );

   //设置cookie,如果不用cookie,就删掉
    $cookie = 'cookie内容';
    curl_setopt($ch, CURLOPT_COOKIE, $cookie);
    // 抓取URL并把它传递给前端
    curl_exec($ch);
    //关闭cURL资源,并且释放系统资源
    curl_close($ch);

本文作者为隔壁小蒋,转载请注明。