温馨提醒
如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
本文最后更新于2020年12月15日,已超过 30天没有更新
修改:/e/class/connect.php文件
在该文件最上面加上以下函数
//获取https链接内容
function getHTTPS($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $result = curl_exec($ch); curl_close($ch); return $result; }
找到ReadFiletext函数如下代码
function ReadFiletext($filepath){ $filepath=trim($filepath); $htmlfp=@fopen($filepath,"r"); //远程 if(strstr($filepath,"://")) { while($data=@fread($htmlfp,500000)) { $string.=$data; } } //本地 else { $string=@fread($htmlfp,@filesize($filepath)); } @fclose($htmlfp); return $string; }
改成
function ReadFiletext($filepath){ $filepath=trim($filepath); $htmlfp=@fopen($filepath,"r"); //远程 if(strstr($filepath,"https://")){ return getHTTPS($filepath); } if(strstr($filepath,"://")) { while($data=@fread($htmlfp,500000)) { $string.=$data; } } //本地 else { $string=@fread($htmlfp,@filesize($filepath)); } @fclose($htmlfp); return $string; }
自此可实现采集https开头的网页链接
版权声明:原创作品,未经允许不得转载,否则将追究法律责任。
本站资源有的自互联网收集整理,如果侵犯了您的合法权益,请联系本站我们会及时删除。
本站资源仅供研究、学习交流之用,若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担。
本文链接:悟空资源网https://www.wkzyw.com/2989.html
许可协议:《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权
本站资源有的自互联网收集整理,如果侵犯了您的合法权益,请联系本站我们会及时删除。
本站资源仅供研究、学习交流之用,若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担。
本文链接:悟空资源网https://www.wkzyw.com/2989.html
许可协议:《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权
评论0+