How to load internal links, and images?

Hello. There is a problem with file_get_contents from one site to pull everything to my website. All images and the main thing that the internal links worked. If I'm on his website click on the link site.ru/statia1.html, data podruzhatsya with donor povar.ru/statia1.html (website for example).

And so I sketched a little, like all it turns out. The data is loaded, but then the page refresh and it loaded forever.

$d = $_SERVER['PHP_SELF'];
$site = "site.ru/";

//trying obratiti internal page If the site site.ru/statia.html then photograham povar.ru/statia.html
if($site != $d){
$a = file_get_contents("https://povar.ru");
echo "$a";
}else{
$a = file_get_contents("https://povar.ru/$d"); 
echo "$a"; 
}


Why might that happen?

In short, I need not only the main donor page, but internal to loaded, if I turn it on its website.
March 23rd 20 at 19:47
1 answer
March 23rd 20 at 19:49
Try to put another site. Most likely the script from the page it reloads.

Find more questions by tags PHP