PHP Include full URL (or website)

I am trying to do something that, in my opinion, was simple, but seems to be wrong.

What I want is to include a separate site in my PHP code. Basically, the reason for this is because I am writing a “home” page that has links to it, and under my links are “included” websites on the same page. The reason is that I'm just building a simple “main” place for all my users to get to our tools. The problem is that our tools are distributed on several other sites (all local and internal in our network). In PHP, I'm not sure if you can do this, and the way to “do it” would be to get the contents of the remote site using file_get_contents():

 <?php
   $a = file_get_contents("http://url/folder");
   echo ($a);
 ?>

The problem with this solution is that all inclusions and links to CSS files are now all broken, because, I believe, with file_get_contents()it it just leads to the source that would be generated, so the CSS code links will be lost and it will inherit CSS The current page is using.

It is almost as if I want it to work as if it were an iframe, but I do not want to use an iframe, I just want to enable remote "websites" on the same page as my interface.

+3
source share
4 answers

, . iframes - , .

0

. / PHP, allow_url_include php.ini . , , URL- -/URL-, , .

0

, [css, js ..], , iframes , http://api.fatherstorm.com/test/, jQuery , , iframe.

0
<HTML>
<HEAD>
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <META http-equiv="Cache-Control" content="no-cache">
     <meta http-equiv="Description" name="Description" content="">
     <meta http-equiv="Keywords" name="Keywords" content="">
     <TITLE>Title</TITLE>
</HEAD>
<FRAMESET rows="*,0">
    <FRAME src="http://url/folder" frameborder="0" noresize>
    <NOFRAMES>
       Your browser does not support frames.
    </NOFRAMES>
</FRAMESET>
</HTML>
0
source

Source: https://habr.com/ru/post/1774528/


All Articles