首页
给我留言
Search
1
精简Win10 ltsb 2016 企业长期服务版 10年的老电脑也能装
856 阅读
2
一个轻量级的文件编辑器Tiny File Manager(个人优化单文件版)
656 阅读
3
宝塔面板7.8.0最新跳过更新代码
393 阅读
4
一款小巧的sqlite可视化管理工具
379 阅读
5
小博客终于备案了
344 阅读
全部
经验
分享
源码
软件
日记
动漫
登录
Search
Moe
累计撰写
14
篇文章
累计收到
66
条评论
首页
栏目
全部
经验
分享
源码
软件
日记
动漫
页面
给我留言
搜索到
14
篇与
admin
的结果
2021-06-23
记一次经常用到的PHP CURL获取页面函数 和 AJAX
CURL:function get_curl($url, $post = 0, $referer = 0, $cookie = 0, $header = 0, $ua = 0, $nobaody = 0) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $klsf[] = "Accept:*"; $klsf[] = "Accept-Encoding:gzip,deflate,sdch"; $klsf[] = "Accept-Language:zh-CN,zh;q=0.8"; curl_setopt($ch, CURLOPT_HTTPHEADER, $klsf); if ($post) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); } if ($header) { curl_setopt($ch, CURLOPT_HEADER, TRUE); } if ($cookie) { curl_setopt($ch, CURLOPT_COOKIE, $cookie); } if ($referer) { if ($referer == 1) { curl_setopt($ch, CURLOPT_REFERER, "http://m.qzone.com/infocenter?g_f="); } else { curl_setopt($ch, CURLOPT_REFERER, $referer); } } if ($ua) { curl_setopt($ch, CURLOPT_USERAGENT, $ua); } else { curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Linux; U; Android 4.0.4; es-mx; HTC_One_X Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0'); } if ($nobaody) { curl_setopt($ch, CURLOPT_NOBODY, 1);//主要头部 //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);//跟随重定向 } curl_setopt($ch, CURLOPT_ENCODING, "gzip"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $ret = curl_exec($ch); curl_close($ch); return $ret; }AJAX:$.ajax({ type: "GET", dataType: "json", url: "api.php?", success: function (result) { //result; } }); }
2021年06月23日
331 阅读
1 评论
1 点赞
2021-06-16
宝塔面板7.8.0最新跳过更新代码
SSH登录ROOT运行:echo "{\"uid\":1000,\"username\":\"admin\",\"serverid\":1}" > /www/server/panel/data/userInfo.json清理浏览器缓存
2021年06月16日
393 阅读
1 评论
1 点赞
1
2
3