Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   RE: PHP rotator script (https://www.warriorforum.com/programming/982747-re-php-rotator-script.html)

magnus1 19th August 2014 07:39 PM

RE: PHP rotator script
 
Hey guys,

I need a rotator script using geotargeting that will send top tier traffic (say US, GB, AUS etc.) to "landing page 1" and all other traffic to "landing page 2". I'm not worried about sub id's or anything like that.

I used to use this for CPA:

<?php

//country code redirect
require_once('geoplugin/geoplugin.class.php');
$geoplugin = new geoPlugin();

$geoplugin->locate();

$country_code = $geoplugin->countryCode;

switch($country_code) {
case 'US':
$url = "AFF_LINK&aff_sub=" . $_GET['a'] . "&aff_sub2=" . $_GET['b'] . "&aff_sub3=" . $_GET['c'];
break;
default: // exceptions
$url = "HOMEPAGE";
break;
}

header("Location:$url");
die;

?>

Can this be modified to do what I need? I understand basic html but this is above my head. Thanks.


Michelle

sbucciarel 19th August 2014 07:40 PM

Re: PHP rotator script
 
You need to ask this here
Programming

WillR 19th August 2014 07:44 PM

Re: PHP rotator script
 
I'd jump on fiverr and find a php programmer. Should be easy for most.

magnus1 19th August 2014 07:58 PM

Re: PHP rotator script
 
Thanks for the tip.

kpmedia 19th August 2014 10:13 PM

Re: PHP rotator script
 
It'll end up simple if/them type statements.

Tap into Maxmind via API to get geo.
If IP match region, load page A
If IP match region, load page B
else
If IP does not match region, load page X

The hard part is the API.
The PHP is somewhat simple by comparison.

You can do this outside of WordPress, yet integrate it to appear as if it's happening inside WordPress. That will make it somewhat easier.

magnus1 20th August 2014 04:44 PM

Re: PHP rotator script
 
Thanks. I was hoping to offer a free solution for my subscribers. I was going to recommend Tracking202 but most of them would find it too complicated to use.


All times are GMT -6. The time now is 03:59 PM.