Ok, one step at a time. [man]fopen()[/man] only gives you a valid file pointer (which I'll call $fp). You must now use that pointer to get the remote data.
//Section 1
//Get a file pointer
$fp = fopen("http://www.ksl.com/phputil/weather/images/web/7north.jpg", "rb")
//if the file pointer is valid, grab the image in 1kb chunks
//and put it into $img
if ($fp) {
_ while (!feof($fp)) {
_ _ _$img = $img . fread($fp, 1024);
_}
}
fclose($fp);
At this point we have a php variable that contains the image as a binary stream. If you want to save the image to disk, do something like this:
//Section 2
$fp2=fopen('mydirectory/myfilename.jpg','wb');
$result=fwrite($fp2,$img,strlen($img));
if(!$result) { die('File write failed!'); }
fclose($fp2);
There really should be more error checking in here, but this is just an example right? The biggest problem will probably be giving php write permissions to mydirectory.
Finally, you can provide the image from an image tag:
//Section 3 - RemotePic.php
//be sure to include the Section 1 code here as well...
header('Accept-Ranges: bytes');
header('Content-Length: '.strlen($img);
header('Connection: close');
header('Content-Type: image/jpeg');
header('Content-Disposition: inline; filename=7north.jpg');
echo "\n";
echo $img;
Now in any (other) php or html page your INTRANET can get that jpg if the server can. Server it up like this:
<img src="RemotePic.php">
Even if internal clients can't reach www.ksl.com, as long as the server can reach the image you can server the image to the INTRANET.
I didn't test any of this code, so be a bit leary of using it verbatim. But it should put you on the right track. The manual is your friend at this point.