There are two sites on the domain and subdomain written in PHP.

It is necessary to display the statistics page on the second site from one site For example, the statistics page has a link http://poddomen.site.ru/counter.php .

How to display it on the second site? The page is prepared, and it needs to be displayed entirely, without cutting anything.

I read how to parse the page, cutting out links and images, but I did not find how to display the whole page.


Request to those who want to really answer the question: Write the entire code.

If you do not know or want to be smart, do not write anything. Fluderasty - not welcome.


I tried using Curl:

$url = "http://poddomen.site.ru/counter.php"; $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch, CURLOPT_ENCODING, "" ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_TIMEOUT, $timeout ); $result = curl_exec($ch); curl_close($ch); var_dump($result); 

The page is displayed, but there is also a message that I do not understand:

string (724) "The content of the output page"

That is, the extra characters are string (724) "" For what reason could it be?

    2 answers 2

    I suggest simply using the iframe tag to display one page inside another.

      if the iframe doesn't suit you for obvious reasons - just use your script from the nested site ?!

      It makes sense to use the parser if you do not have access to any data or functionality.

      simplehtmldom example of simplehtmldom you can get a page like this

      file_get_html (' http://www.google.com/ ');

      • I do not know what you are trying to parse page, it is not indicated in the question. Using the example of simplehtmldom, I threw off to you the receipt of the page of the dock here simplehtmldom.sourceforge.net/manual.htm - username