I’m trying to do something that I thought was simple but doesn’t appear to be so.
What I’m wanting is to be able to include a separate website in my PHP code. Basically, the reason for this is that I’m writing a “main” page that has links on it, and below my links are the “included” websites in the same page. Reasoning is, I’m just building a simple “main” place for all my users to get to our tools. The problem is, our tools are spanned out across several other websites (all local and internal to our network). In PHP, I’m not sure you can do this, and the way to “do this” 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 the includes and references to CSS files are now all broken, because, I believe, with file_get_contents() it just brings over the source that would have been generated, so links CSS code will be lost and it will inherit the CSS that the current page uses.
It’s almost like I want this to work as if it were like an iframe, but I don’t want to use iframes, I just want to be able to include remote “websites” in the same page as my frontend.
Well generally a solution would be to parse the source code and fix the links yourself. Although I’d still have a tendency to use iframes – that’s what they’re useful for.