如:http://www.expreview.com/39435.html
在本地服务器(localhost)可以正常采集  放到线上服务器就自动跳转了

解决方案 »

  1.   

    include 'curl/curl_get.php';$url = 'http://www.expreview.com/39435.html';
    echo curl_get($url);<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>免费升级提前来袭:微软宣布夏季发布Windows 10正式版 - 超能网</title>    <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 
        <meta name="keywords" content="超能网,expreview.com,评测,科技,硬件,显卡,智能手机,平板,主板,CPU,散热器,机箱,电源,游戏,高清,性能,测试" />
    <meta name="description" content="超能网(Expreview)专注于为主流科技产品提供全新视角的资讯,专注于100%高价值原创内容的创造,专注于最真实的体验式报道。" />
    <!-- Loading Style -->
     <link href="/exp_new/static/exp4/css/article_album.css" rel="stylesheet"/><link href="/exp_new/static/exp4/css/article_picture.css" rel="stylesheet"/>   <link href="/data/cache/style_1_common.css" rel="stylesheet"/>
        <!-- Loading other -->
        <link href="/exp_new/static/exp4/css/bootstrap.css" rel="stylesheet"/>
        <link href="/exp_new/static/exp4/css/buttons.css" rel="stylesheet"/>
        <link href="/exp_new/static/exp4/css/font-awesome.css" rel="stylesheet"/>
    ..........
      

  2.   

    curl_get.php这个是哪个?
      

  3.   

    这个文件我贴过好几遍了<?php
    function curl_get($durl, $data=array()) {
      $cookiejar = realpath('cookie.txt');
      $t = parse_url($durl);
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL,$durl);
      curl_setopt($ch, CURLOPT_TIMEOUT,5);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
      curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
      curl_setopt($ch, CURLOPT_REFERER, "http://$t[host]/");
      curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
      curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
      curl_setopt($ch, CURLOPT_ENCODING, 1); //gzip 解码
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    if($data) {
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    }
      $r = curl_exec($ch);
      curl_close($ch);
      return $r;
    }
      

  4.   


    sorry 没看到  谢谢版主回答~