View Single Post
Old 05-23-2012, 01:07 AM  
X_X_ROB_X_X
( ◣_◢ )
 
Industry Role:
Join Date: Jun 2007
Location: USA
Posts: 509
Are you any good with PHP?

I'm using a Geo Targeting script that was shared here a while ago. I've had some changes made to it to rotate the Tier1 URLs and split my AU, CA, UK, US traffic up between 2 separate affiliate links.

What I would like to do is also split up my Tier2 (foreign ) traffic the same way so I can send it to a couple different programs too. I've been messing with it for a while now but can't seem to get it to work.

Would any PHP coders mind having a look at it and showing me the best way to accomplish this?
Thanks in advance ;)

PHP Code:
<?php
    
    $geo 
unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$_SERVER['REMOTE_ADDR']));
    
$countryCode $geo['geoplugin_countryCode'];

    
$a=array('AD''AE''AF''AG''AI''AL''AM''AN''AO''AQ''AR''AS''AT''AW''AX''AZ''BA''BB''BD''BE''BF''BG''BH''BI''BJ''BM''BN''BO''BR''BS''BT''BV''BW''BY''BZ''CC''CD''CF''CG''CH''CI''CK''CL''CM''CN''CO''CR''CS''CU''CV''CX''CY''CZ''DE''DJ''DK''DM''DO''DZ''EC''EE''EG''EH''ER''ES''ET''FI''FJ''FK''FM''FO''FR''FX''GA''GB''GD''GE''GF''GH''GI''GL''GM''GN''GP''GQ''GR''GS''GT''GU''GW''GY''HK''HM''HN''HR''HT''HU''ID''IE''IL''IN''IO''IQ''IR''IS''IT''JM''JO''JP''KE''KG''KH''KI''KM''KN''KP''KR''KW''KY''KZ''LA''LB''LC''LI''LK''LR''LS''LT''LU''LV''LY''MA''MC''MD''MG''MH''MK''ML''MM''MN''MO''MP''MQ''MR''MS''MT''MU''MV''MW''MX''MY''MZ''NA''NC''NE''NF''NG''NI''NL''NO''NP''NR''NU''NZ''OM''PA''PE''PF''PG''PH''PK''PL''PM''PN''PS''PT''PW''PY''QA''RE''RO''RU''RW''SA''SB''SC''SD''SE''SG''SH''SI''SJ''SK''SL''SM''SN''SO''SR''ST''SU''SV''SY''SZ''TC''TD''TF''TG''TH''TJ''TK''TL''TM''TN''TO''TP''TR''TT''TV''TW''TZ''UA''UG''UY''UZ''VA''VC''VE''VN''VU''WF''WS''YE''YT''YU''ZA''ZM''ZR''ZW'); 

    if (
in_array($countryCode$a)) {
        
header ('Location: http://www.Tier2-Affiliate-Link-1.com');
    } 
    else {
        
$destination_list = array(
            
'http://www.Tier1-Affiliate-Link-1.com',
            
'http://www.Tier1-Affiliate-Link-2.com'
        
);

        
$key rand(0count($destination_list) - 1);
        
        
header ('Location: '$destination_list[$key] .'');
        exit();
    }
?>
X_X_ROB_X_X is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote