43.gif

Search (advanced search)
Use this Search form before posting, asking or make a new thread.
Tips: Use Quotation mark to search words (eg. "How To Make Money Online")

09-08-2015, 11:41 PM
Post: #1
[GET] GEO cloaking script
here is a quick GEO cloaking script to redirect users based on IP location.
thought maybe someone here has a use for it.
nothing special, but has its use:

Code:
<?php
/* quick and dirty GEO cloaking script
   by styx @ argo-content.com 2014 */

   $geo[0][0]='DE';
   $geo[0][1]='http://google.com';
   $geo[1][0]='US';
   $geo[1][1]='http://aol.com';

   $cnt=sizeof($geo);
   $ip=$_SERVER['REMOTE_ADDR'];
   if(isset($ip)and&ip2long($ip) !== false) {
      $fp=fsockopen("asn.shadowserver.org",43,$ern,$ers,20);
      if(!$fp) { die("$ern:$ers\n"); }
      $data="begin origin\n$ip\nend\n";
      fwrite($fp,$data);
      while(!feof($fp)) {
         $output.=fgets($fp,255);
      }
      fclose($fp);
      $out=explode('|',$output);
      $match=trim($out[4]);
      for($i=0;$i<$cnt;$i++) {
         if($match===$geo[$i][0]) {
            $u=$geo[$i][1];
            header("Location: $u");
         }
      }
   }
?>

cheers :)
09-08-2015, 11:43 PM
Post: #2
RE: [GET] GEO cloaking script
nice share:)
09-09-2015, 03:12 AM
Post: #3
RE: [GET] GEO cloaking script
thank you :)
09-09-2015, 03:31 AM
Post: #4
RE: [GET] GEO cloaking script
thanks for this,
but got 1 question

if i want to add 3 and 4th country, i have to add this??

Code:
$geo[2][0]='US';
   $geo[2][1]='http://aol.com';

$geo[3][0]='US';
   $geo[3][1]='http://aol.com';
09-09-2015, 04:50 AM (This post was last modified: 09-09-2015 04:51 AM by styx.)
Post: #5
RE: [GET] GEO cloaking script
almost :) you need to add it like this:

Code:
$geo[2][0]='XX';
$geo[2][1]='http://aol.com';

$geo[3][0]='XY';
$geo[3][1]='http://aol.com';

as you can't have 2 times the same country :)
26.gif
09-09-2015, 03:02 PM
Post: #6
RE: [GET] GEO cloaking script
please post "all countries preloaded" script.

or at least tell "how to add more countries" with example.

thanks in advance.
09-09-2015, 06:43 PM
Post: #7
RE: [GET] GEO cloaking script
(09-09-2015 04:50 AM)styx Wrote:  almost :) you need to add it like this:

Code:
$geo[2][0]='XX';
$geo[2][1]='http://aol.com';

$geo[3][0]='XY';
$geo[3][1]='http://aol.com';

as you can't have 2 times the same country :)

yeah thanks man got it :)
rep added..
09-09-2015, 09:10 PM
Post: #8
RE: [GET] GEO cloaking script
@star79 np :)

@gumdaj just read the previous posts, its explained there ;)
09-19-2015, 11:53 PM
Post: #9
RE: [GET] GEO cloaking script
hey bro, where to edit that,
the reset of the traffic goes to what link?

it didnt mention that?
09-22-2015, 08:05 PM
Post: #10
RE: [GET] GEO cloaking script
i tried making a file redirect.php

and put this code in that, it didnt work,

any suggestions??
33.gif




59.gif
Free counters!