比如说 UserAgent ,Referrer,Header,Cookie啥的。
进入e目录 composer require php-curl-class/php-curl-class
- https://github.com/php-curl-class/php-curl-class
修改connect.php加入
修改 取得文件内容 的这个 function。
- define('STR_IREPLACE', function_exists('str_ireplace'));
- require ECMS_PATH . './e/vendor/autoload.php';
- use CurlCurl;
//取得文件内容
- function ReadFiletext($filepath)
- {
- $filepath = trim($filepath);
- //远程
- if (strstr($filepath, "http://www.aaa.cn")) {
- $curl = new Curl();
- $curl->setCookie('cookie','');
- $curl->get($filepath);
- $string = $curl->response;
- } else if (strstr($filepath, "://")) {
- $htmlfp = @fopen($filepath, "r");
- while ($data = @fread($htmlfp, 500000)) {
- $string .= $data;
- }
- @fclose($htmlfp);
- } //本地
- else {
- $htmlfp = @fopen($filepath, "r");
- $string = @fread($htmlfp, @filesize($filepath));
- @fclose($htmlfp);
- }
- return $string;
- }