Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redirect By Location Code
#1
Code:
you can't add the
{keyword} curly braces into the script. if your domain is destination
url is http://www.mydomain.com/track/AC01.php?kw={keyword} - what you
want is the value of ?kw= - which will be whatever keyword you are
bidding on.

So we'll grab that at the top of the script and pass it along to your
P202 link.
PHP Code:
<?php
// gets keyword and stores it as $kw
$kw = $_GET['kw'];


require_once('geoplugin.class.php');
$geoplugin = new geoPlugin();
$geoplugin->locate();
$country_code = $geoplugin->countryCode;
switch($country_code) {


case 'US':
header("Location:
http://redirect.tracking202.com/dl/49937675?t202kw=$kw");
exit;
case 'CA':
header('Location: http://www.rootdomain.com');
exit;
case 'GB':
header('Location: http://www.rootdomain.com');
exit;
case 'IE':
header('Location: http://www.rootdomain.com');
exit;
case 'AU':
header('Location: http://www.rootdomain.com');
exit;
case 'NZ':
header('Location: http://www.rootdomain.com');
exit;
default: // exceptions
header('Location: http://www.rootdomain.com');
exit;
}
?>
the only difference is the 1 line at the top, and to embed variables
($kw) you need to use double quotes . this example below won't work
because it's single quotes
PHP Code:
header('Location:
http://redirect.tracking202.com/dl/49937675?t202kw=$kw');  
this will work
PHP Code:
header("Location:
http://redirect.tracking202.com/dl/49937675?t202kw=$kw");
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)