In our sites we are doing a image protection section. So as a part of image protection we need provide antihotlinking for images.In our site we are showing the image using a
in image_file.php use http_referer for this.
$ref = isset($_SERVER['HTTP_REFERER'])? $_SERVER['HTTP_REFERER']: "";
if ($ref != "" && strpos($ref,'http://www.yourdomain.com/')===0)
{
//the request for this image is coming from some other domain, so take appropriate action
}
else
{
//do whatever logic you are currently using to show the images
}
Find a full-blown solution here: http://safalra.com/programming/php/prevent-hotlinking/