douniani679741 2016-10-10 13:10
浏览 15
已采纳

我可以命中一个端点并获取/回显<body>吗? [关闭]

I currently don't even know what exactly to search, don't know if that procedure has a name or something, that's why i decided to post a question.

For example, when i hit mysite/test.php i want that php to make a request to another .php on another server and get all the html contents of that page and echo it in test.php, is that even possible?

Let's suppose test.php is that php file which makes a request to take_me.php .

take_me.php could have just an echo or it could be a full content page.

Can i have the content of take_me.php shown in test.php?

  • 写回答

1条回答 默认 最新

  • doushang3352 2016-10-10 13:13
    关注

    You could use file_get_contents and echo to screen like below:

    $html = file_get_contents('http://www.google.com');
    
    if (isset($html)) {
    
        echo $html;
    
    }
    

    You may have issue with images rendering correctly etc... due to paths but it will work.

    http://php.net/manual/en/function.file-get-contents.php

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面