Here's a version that will stop hotlinking, but also allow sites that you define to be able to hotlink to images on your site, whether they are in proxified pages, or images that are hosted on your site:
/*
PHProxy bandwidth MOD by Rhett Canney (Billy Connite)
This MOD will stop any hotlinking via PHProxy, even if the
clients referer is not set!
*/
$domains[]="www.proxy-talk.com";
$domains[]="proxy-talk.com";
$domains[]="www.station2you.com";
$domains[]="station2you.com";
// Get referer
$referer=explode("/",($_SERVER['HTTP_REFERER']));
// Check to see if referer is not the proxys domain
// If there is an outside referer:
if(!in_array($referer[2],$domains)){
// If there is a request:
if($_GET['q']!=""){
// Redirect to homepage and finish script
header("Location: http://www.someaddress.com/something.html");
exit();
}
}
/*
END MOD
*/