FINAL RESULTS, (I hope!!! {🙂)
Hello All:
For those of you who may be interested, I read all of the suggestions and here's what seems to work. Thank you to all who helped!
Brian
==============================================
First, the calling HTML file
<body>
This is text BEFORE the picture
<img src="showpic.php?img=805101">
This is text after the picture
</body>
==============================================
Now the php script that will server the picture ONLY if called from my server.
<?
// this script should only show a picture IF the calling script is on MY server?
$url = parse_url($HTTP_REFERER);
$checkurl = strtolower($url["host"]);
if ($checkurl != "mydomain.com") {
echo "I'm sorry, but we are unable to respond to your request at this time...";
exit;
}
if (!isset($img)) {
echo "No Picture Specified...";
} else {
$picpath = "http://mydomain.com/picdir/";
$picdir = substr($img,0,3);
$filename = $picpath . $picdir . "/" . $img . ".jpg";
header("Content-Type: image/jpeg");
$image = fread(fopen($filename,"r"),100000);
echo $image;
fclose($image);
}
?>
==============================================
That's it! Anyone see any holes?
Thanks,
Brian