1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need some PHP Cloaking scripting here

Discussion in 'Cloaking and Content Generators' started by macbookpro, Aug 10, 2011.

  1. macbookpro

    macbookpro Registered Member

    Joined:
    Sep 2, 2010
    Messages:
    76
    Likes Received:
    13
    So my ads keep getting disapproved on Adcenter because of using direct linking to offer.

    What i need is a PHP code that will check ips of visitors from Ip.txt file and if ip is not listed on txt , script will perform a redirect to offer url.

    If ip is listed in ip.txt file then it will stay on the same page which is index.php.

    P.S :
    My Ip base has IP blocks such as 100.100.0.0
    So Php code should understand its an ip block.

    Any help is appreciated. Thanks.
     
  2. Barbacamanitu

    Barbacamanitu Jr. VIP Jr. VIP Premium Member

    Joined:
    May 8, 2008
    Messages:
    500
    Likes Received:
    91
    How do you plan on getting all of adwords ip addresses?
     
  3. ExtremeSEO

    ExtremeSEO BANNED BANNED

    Joined:
    Nov 11, 2009
    Messages:
    364
    Likes Received:
    394
    Should be an easy script. You wanted it in PHP or a Plugin? Also, in regards to the IP's...you just wanted to be able to add the IP's manually?
     
  4. ExtremeSEO

    ExtremeSEO BANNED BANNED

    Joined:
    Nov 11, 2009
    Messages:
    364
    Likes Received:
    394
    Here is how you would redirect without a script and just using your .htaccess file:

    Redirect based upon IP:
    HTML:
    # permanently redirect specific IP request for entire site 
    Options +FollowSymlinks 
    RewriteEngine on 
    RewriteCond %{REMOTE_HOST} 22\.22\.22\.239 
    RewriteRule \.php$ http://www.redirectsite.com/ [R=301,L] 
    

    Redirect based upon IP range:
    HTML:
    # permanently redirect specific IP request for entire site 
    Options +FollowSymlinks 
    RewriteEngine on 
    RewriteCond %{REMOTE_HOST} 22\.22\.22\.239 
    RewriteRule \.php$ http://www.redirectsite.com/ [R=301,L] 
    
     
  5. Autumn

    Autumn Elite Member

    Joined:
    Nov 18, 2010
    Messages:
    2,197
    Likes Received:
    3,041
    Occupation:
    I figure out ways to make money online and then au
    Location:
    Spamville
    There you go. If you like it then you know what buttons to push.

    Code:
    <?php
    
    /*************************************************************************\
    Simple IP redirect
    
    By Autumn@BHW
    
    Created:  Fri Aug 12 12:13:44 NZST 2011
    \*************************************************************************/
    
    // File with IP list in it
    $ip_file = '/path/to/ips.txt';
    
    // Redirect to issue surfers
    $redirect_url = 'http://myspammyredirect.com/';
    
    // HTML to show to PPC reviewers
    $content = '<html>
    <head>
    <title>Hi Reviewer</title>
    </head>
    <body>
    <h1>Fucking blow me you prick</h1>
    </body>
    </html>
    ';
    
    
    /*************************************************************************/
    // Load list of IPs
    $lines = file($ip_file);
    foreach($lines as $line) {
    	$ips[] = trim($line);
    }
    
    // Get surfer's IP
    $remote_ip = $_SERVER['REMOTE_ADDR'];
    
    // Issue redirect or show reviewer content
    if(in_array($remote_ip, $ips)) {
    	header("Location: $redirect_url", true, 301);
    	exit;
    } else {
    	echo "$content\n";
    }
    
    
    ?>
    
     
    • Thanks Thanks x 3
  6. ExtremeSEO

    ExtremeSEO BANNED BANNED

    Joined:
    Nov 11, 2009
    Messages:
    364
    Likes Received:
    394
    nice...you beat me to it
     
  7. macbookpro

    macbookpro Registered Member

    Joined:
    Sep 2, 2010
    Messages:
    76
    Likes Received:
    13
    PHP better .. I will keep IPs in a seperate text file.

    My hosting disa bled htaccess due to some abuse. Thanks anyway.

    I am going to try it tonight. Thanks...

    Who saidsomething about adwords ? :)
    In anyway I have all ip lists of most common PPC editors. I am doing this business for a long time. I just lost my access to my cloaking software for a few days.
     
  8. Seetheworldthru

    Seetheworldthru Newbie

    Joined:
    Aug 4, 2011
    Messages:
    19
    Likes Received:
    0
    I have the ultimate tool for you PM me for details and I am willing to sell it, its a supercloaker.
     
  9. macbookpro

    macbookpro Registered Member

    Joined:
    Sep 2, 2010
    Messages:
    76
    Likes Received:
    13
    Thanks for the code but thats not working for me...
    I think you wrote if else variable opposite..
     
  10. macbookpro

    macbookpro Registered Member

    Joined:
    Sep 2, 2010
    Messages:
    76
    Likes Received:
    13

    Thank you for helping but this code work only for exact ips on ips.txt file. However i have ip c range such as :
    24.228.0.0
    24.228.0.0/16 (CIDR)
    24.228.
    24.228.*
    24.228..*..*

    This script dont recoginize block range :(
     
    • Thanks Thanks x 1
  11. Autumn

    Autumn Elite Member

    Joined:
    Nov 18, 2010
    Messages:
    2,197
    Likes Received:
    3,041
    Occupation:
    I figure out ways to make money online and then au
    Location:
    Spamville
    Sorry, I've got too much of my own work to do to write the regex right now. However the first thing you should do is standardize your list of IP ranges into a single consistent format. You're right, the if/else should be in the opposite order.
     
  12. chinesestyle

    chinesestyle Newbie

    Joined:
    Apr 16, 2010
    Messages:
    9
    Likes Received:
    1
    ...............................................................................................................
     
    Last edited: Feb 15, 2012