代码之家  ›  专栏  ›  技术社区  ›  DEVOPS

如何在不使用iframe的情况下显示我们网站中的其他网站内容?

  •  0
  • DEVOPS  · 技术社区  · 15 年前

    如何在不使用iframe的情况下显示我们网站中的其他网站内容? 是否可以在不使用iframe的情况下在我们的站点中加载一个站点文件详细信息?

    6 回复  |  直到 15 年前
        1
  •  3
  •   Gazler    15 年前
        2
  •  1
  •   gblazex    15 年前
        3
  •  0
  •   Codemwnci    15 年前

    <?php
    $handle = fopen("http://someurl", "rb");
    $contents = stream_get_contents($handle);
    fclose($handle);
    
    echo "<div>Your Content</div>";
    echo "<div>";
    print($contents);
    echo "</div>";
    echo "<div>More of your contents";
    
    ?>
    
        4
  •  0
  •   Joyce Babu    15 年前
        5
  •  0
  •   KalenGi    15 年前

    <object id="external-page" type="text/html" data="" > 
    
    </object>
    

    $("#external-page").attr("data", "http://foreign-site.net/foreign-page.html");
    
        6
  •  -2
  •   Dave    15 年前