帝国cms

推荐列表 站点导航

当前位置:首页 > 建站教程 > 帝国cms >

帝国cms后台采集支持https开头的协议地址修改方法

来源:互联网  作者:网络  发布时间:2020-12-07 18:45
帝国CMS模板网下面的帝国CMS教程栏目为您提供了帝国cms后台采集支持https开头的协议地址修改方法...

修改:/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开头的网页链接

相关热词: 帝国cms 方法

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://www.juheyunku.com/jz/ecms/1101.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

帝国cms后台采集支持https开头的协议地址修改方法

2020-12-07 编辑:网络

修改:/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.juheyunku.com/jz/ecms/1101.shtml

相关文章

风云图片

推荐阅读

返回帝国cms频道首页