PHProxy hotlinking

Discussion in 'PHP' started by stevenhartley, Aug 17, 2007.

  1. #1
    Hello everyone,

    I've tried adding this hotlinking code to some of my proxies, but when I try browsing I just get sent to the redirect, example site

    /*
    PHProxy bandwidth MOD 
    This MOD will stop any hotlinking via PHProxy, even if the
    clients referer is not set!
    Check out ProxyWebsite.com if you want to try hotlinking.
    */
    
    // Change this to your domain (no 'www.')
    $domain="proxynetwork.org";
    
    // If no request:
    if($_GET['q']!=""){
      // Get referer
      $referer=$_SERVER['HTTP_REFERER'];
      // Check to see if referer is not the proxys domain
      $count=substr_count($referer,$domain);
      // If there is an outside referer:
      if($count==0){
        // If there is a request:
        if($_GET['q']!=""){
          // Redirect to homepage and finish script
          header("Location: http://www." . $domain . "/");
          exit();
        }
      }
    }
    
    /*
    END MOD
    */
    PHP:
    Any ideas so people can actually browse whilst having the hotlink code in place.

    Thanks in advance,
    Steven Hartley
     
    Last edited by a moderator: Sep 28, 2025
    stevenhartley, Aug 17, 2007 IP
  2. Scriptona

    Scriptona Notable Member

    Messages:
    4,957
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    280
    #2
    I thinks it doesn't work with recent versions with php 5

    not sure though
     
    Scriptona, Aug 19, 2007 IP
  3. hip_hop_x

    hip_hop_x Active Member

    Messages:
    522
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #3
    I wrote my own system for my proxy. Make a database and set nr max of hits that your proxy website can handle per day. Once the website reaches max hits, website will close down auto, use fetch. And to have everything working, make a cron job to reset the hits reached after 24 hours to 0.
     
    hip_hop_x, Aug 19, 2007 IP