[HQ] [PHP SCRIPT] FOR COUNTRY REDIRECT
2016-09-15, 03:23 PM,
(This post was last modified: 2016-09-15, 04:33 PM by trafficbeast.)
#1
Many guys asked me so i coded it with love Surprised


CODE:
Register or login to see this content

1. how to get API

register here: http://ipinfodb.com/register.php
WAIT!! see step 2

2. how to get your server/shared hosting IP
this IP you need to put as server IP while registering account on above url

use this php code:
PHP Code:
<?php
ob_start
();

//get IP
    
$client  = @$_SERVER['HTTP_CLIENT_IP'];
    
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
    
$remote  $_SERVER['REMOTE_ADDR'];

    if(
filter_var($clientFILTER_VALIDATE_IP))
    {
        
$ip $client;
    }
    elseif(
filter_var($forwardFILTER_VALIDATE_IP))
    {
        
$ip $forward;
    }
    else
    {
        
$ip $remote;
    }


 
$api_key 'PUTYOURAPIKEYHERE'//please put API

$data file_get_contents("http://api.ipinfodb.com/v3/ip-city/?key=$api_key&ip=$ip&format=json");
$data = (array) json_decode($data);
$c $data['countryCode'];

 
// ES is country code for spain
if($c=="ES"
{
//do actions on this country
header("Location: http://urlofthisEScountry.com");
}
else if(
$c=="FR")
{
header("Location: http://urlofthisFRcountry.com");
}
else if(
$c=="IT")
{
header("Location: http://urlofthisITALYcountry.com");
}

//put soo on!

?>

run above code on your server to know ur server IP

3. put API key inside your php file in $api_key = '';

4. define your rules for country redirect


here are list of all country and their country codes
https://countrycode.org/
http://www.nationsonline.org/oneworld/co...e_list.htm

example: ES for spain, FR for france.

put if($c=="ES") for spain redirect rule and soo on!


remove non needy code like this:
example if u want spain only..


if($c=="ES")
{
header("Location: http://urlofthisEScountry.com");
}

i cant explain more but u need some knowledge of php..

thanks!


I RECOMMEND YOU USING CPAELITES CODE:

http://www.cpaelites.com/tools/
Latest Thanks - View all

hen(2017-10-18 09:27 PM) xeraz(2017-04-22 12:18 AM) Pazuzu(2017-03-10 01:47 AM) bapatana(2017-01-01 08:31 PM) javirap(2016-11-24 12:03 PM) Mangjose(2016-11-17 12:21 PM) revrs(2016-11-06 02:42 AM) discoverynetcom(2016-10-26 07:43 AM) Eau2vie(2016-10-03 12:31 AM) dixslacker(2016-09-25 10:48 AM) syncmaster(2016-09-23 02:32 AM) dragon182(2016-09-17 04:44 PM) creativehead(2016-09-17 09:02 AM) mmarko1(2016-09-17 02:56 AM) blackmint(2016-09-16 08:29 PM) Dollerking(2016-09-16 02:12 PM) Raman saab(2016-09-16 12:33 PM) Emit(2016-09-16 09:21 AM) BO$$(2016-09-16 04:32 AM) tirycm(2016-09-16 04:20 AM) geocath(2016-09-15 10:36 PM) mobo12(2016-09-15 10:15 PM) xboebefax(2016-09-15 05:41 PM) 

TESTED METHOD TO EARN MONEY WITH PPV - AUTOPILOT- ONLY FOR CPAELITES

ABOVE METHOD in signature, has WORKED FOR ME AND MY FRIENDS. Cool ENJOY FOR VIP ONLY
Reply
2016-09-15, 05:14 PM,
(This post was last modified: 2016-09-15, 05:15 PM by SuperSimple.)
#2
There's a much simpler version, no API needed.

Here you go:

Just create new php file "redirect.php" and copy paste this script to it. And don't forget to change your links.

Code:
<?php


$call = unserialize(file_get_contents('http://ip-api.com/php/'.$_SERVER['REMOTE_ADDR']));
$country = $call["countryCode"];




if ($country == "US") {
  header("Location: url=http://example.com/us.php");
}
elseif ($country == "CA") {
  header("Location: http://example.com/ca.php");
}
elseif ($country == "MX") {
  header("Location: http://example.com/mx.php");
}
elseif ($country == "ID") {
  header("Location: http://example.com/id.php");
}
elseif ($country == "PH") {
  header("Location: http://example.com/ph.php");
}

else {
  header("Location: http://example.com/other.php");
}


exit();
?>
<!DOCTYPE html>
<html lang="en"><head>



<meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="robots" content="noindex, nofollow">
  
</head>
<body>


    
<center>
<h3>You are being Redirected</h3>



</center>
</body>
</html>
Latest Thanks - View all

mdysnt(2016-09-16 02:50 PM) 
Reply
2016-09-15, 05:25 PM,
#3
(2016-09-15, 05:14 PM)SuperSimple Wrote: There's a much simpler version, no API needed.

Here you go:

Just create new php file "redirect.php" and copy paste this script to it. And don't forget to change your links.

Code:
<?php


$call = unserialize(file_get_contents('/php/'.$_SERVER['REMOTE_ADDR']));
$country = $call["countryCode"];




if ($country == "US") {
  header("Location: url=/us.php");
}
elseif ($country == "CA") {
  header("Location: /ca.php");
}
elseif ($country == "MX") {
  header("Location: /mx.php");
}
elseif ($country == "ID") {
  header("Location: /id.php");
}
elseif ($country == "PH") {
  header("Location: /ph.php");
}

else {
  header("Location: /other.php");
}


exit();
?>
<!DOCTYPE html>
<html lang="en"><head>



<meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="robots" content="noindex, nofollow">
  
</head>
<body>


    
<center>
<h3>You are being Redirected</h3>



</center>
</body>
</html>



this and many other script not worked .. when traffic was TOO high they suspend ur server IP Smile

TESTED METHOD TO EARN MONEY WITH PPV - AUTOPILOT- ONLY FOR CPAELITES

ABOVE METHOD in signature, has WORKED FOR ME AND MY FRIENDS. Cool ENJOY FOR VIP ONLY
Reply
2016-09-15, 06:31 PM,
#4
(2016-09-15, 05:25 PM)trafficbeast Wrote: this and many other script not worked .. when traffic was TOO high they suspend ur server IP Smile

Yeah, they have limits of something like 100/minute, but the free API you've provided have almost the same limits. If traffic volume is high it's better to setup your own checker or to buy an API with bigger/unlimited limits.
Reply
2016-09-15, 06:32 PM,
(This post was last modified: 2016-09-15, 06:32 PM by trafficbeast.)
#5
(2016-09-15, 06:31 PM)SuperSimple Wrote:
(2016-09-15, 05:25 PM)trafficbeast Wrote: this and many other script not worked .. when traffic was TOO high they suspend ur server IP Smile

Yeah, they have limits of something like 100/minute, but the free API you've provided have almost the same limits. If traffic volume is high it's better to setup your own checker or to buy an API with bigger/unlimited limits.

yaa haa haa.. its ok i can code my own when i got time

(2016-09-15, 06:31 PM)SuperSimple Wrote:
(2016-09-15, 05:25 PM)trafficbeast Wrote: this and many other script not worked .. when traffic was TOO high they suspend ur server IP Smile

Yeah, they have limits of something like 100/minute, but the free API you've provided have almost the same limits. If traffic volume is high it's better to setup your own checker or to buy an API with bigger/unlimited limits.

how ever i have cpvlabs latest Null3D too!

so its good for this

TESTED METHOD TO EARN MONEY WITH PPV - AUTOPILOT- ONLY FOR CPAELITES

ABOVE METHOD in signature, has WORKED FOR ME AND MY FRIENDS. Cool ENJOY FOR VIP ONLY
Reply
2016-09-15, 06:54 PM,
#6
(2016-09-15, 06:32 PM)trafficbeast Wrote: how ever i have cpvlabs latest Null3D too!

so its good for this

Good for you. Maybe you could share it with us? ;)
Reply
2016-09-16, 04:13 AM,
#7
Money Cashers has shared something like this too and I would recommend you guys using that, I've used it in past and it worked very well
BTW thanks for the share OP
Latest Thanks - View all

trafficbeast(2016-09-16 02:54 PM) 
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [HQ Tutorial]»» Boost your conversions/CTR - add a countdown to your landing page «« allnet 60 8,945 2017-10-14, 11:05 AM
Last Post: sudipda
  [HUGE COLLECTION] 700 Php Websites and Scripts [NEW] insomniac 81 19,387 2017-10-11, 08:43 AM
Last Post: ann627
  [FREE] Cloak Script Watt 37 2,399 2017-10-06, 10:03 AM
Last Post: Watt
  [GET] Script To Boost Alexa Rank akwin 21 4,808 2017-10-05, 02:37 PM
Last Post: iastaff
  $HQ$ ●Hot Template For Blogger And Html Both!● PRINC3 11 1,187 2017-10-04, 11:32 AM
Last Post: ecloudicstars




About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top