Images dont load while fetching a web page!!


$c = curl_init(‘http://shannon/’);
$page = curl_exec($c);
echo $page;

when i use the above code to fetch a url. the images on the url dont show up. why is this happening. i tried fopen and i still get the same problem!!
please help!



You could try fsockopen(), or do some magic with base64_encode() (I think … better check the manual for that).


I think the reason is very simple - curl downloads only html code of the page (or other format if server returns something else). So, images should be downloaded separately, if you want to pack the page. Usually, if you are showing the page returned by the curl on your site, web browser is able to download missed images, but there can be some problems with proxy servers or when you allowed images from the same server only :wink: