Guest User

DisableProxyHotlinking

a guest
Jan 11th, 2012
216
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. PHProxy bandwidth MOD by Rhett Canney (Billy Connite)
  3. This MOD will stop any hotlinking via PHProxy, even if the
  4. clients referer is not set!
  5. Check out ProxyWebsite.com if you want to try hotlinking.
  6. */
  7. // Thay đổi anhhangxomonline.net thành tên miền của bạn, không có tiền tố "wwww"
  8. $domain="anhhangxomonline.net";
  9. // If no request:
  10. if($_GET['q']!=""){
  11.     // Get referer
  12.     $referer=$_SERVER['HTTP_REFERER'];
  13.     // Check to see if referer is not the proxys domain
  14.     $count=substr_count($referer,$domain);
  15.     // If there is an outside referer:
  16.     if($count==0){
  17.         // If there is a request:
  18.         if($_GET['q']!=""){
  19.             // Redirect to homepage and finish script
  20.             header("Location: http://www." . $domain . "/");
  21.             exit();
  22.         }
  23.     }
  24. }
  25. /*
  26. END MOD
  27. */
RAW Paste Data