I am trying to display shared sites and URLs as part of my own site. Here is part of the relatively simple code that I use:
browse.php
<?
$enteredurl = $_GET["url"];
$page = file_get_contents($enteredurl);
echo $page;
?>
Ignoring the fact that some links / images will not work if the URls are relative and not absolute, this works fine. Access to the pages is done using $ _GET, something like
browse.php? url = http://itracki.com
The web page will display as expected. However, when I try to get something else, like an image, do I get something like this, which I think is binary or something else?
browse.php? url = http://images.itracki.com/2011/06/favicon.png
‰PNG IHDRóÿa%IDAT8Ëc8sæÌJ0M ```ã3`xaÔ€aa]r
, -
<? header('Content-type: image/png;'); ?>
. - , , , " http://images.itracki.com/2011/06/favicon.png"?
!