Website Redirect

Discussion in 'Programming' started by kolucoms6, Mar 25, 2010.

  1. #1
    
    
    <?php 
    require_once('geoip.inc'); 
    
    $gi = geoip_open('GeoIP.dat', GEOIP_MEMORY_CACHE); 
    $country = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']); 
    geoip_close($gi); 
    
    $my_countries = array('us', 'ca', 'gb', 'fr', 'de', 'nl'); 
    $uk='uk'; 
    $us='us'; 
    $ca='ca'; 
    
    echo $gi;
    echo $country;
    
    if ($country==$uk) 
    { 
    header('Location: http://www."ALL"UK_TRAFFICURLGOESHERE.whatever'); 
    } 
    if($country==$us) 
    { 
    header('Location: http://www."ALL"www.microtechbuddy.co.cc'); 
    } 
    if($country==$ca) 
    { 
    header('Location: http://www."ALL"CA_TRAFFICURLGOESHERE.whatever'); 
    } else { 
    header('Location: http://www."ALL"www.yahoo.com'); 
    } 
    
    ?>
    
    Code (markup):
    I am using above code to redirect my site as PER IP.

    When It shows me only

    "????"

    I have GeoIP.dat and geoip.inc file in the folder.

    What cld be the Error ??
     
    kolucoms6, Mar 25, 2010 IP
  2. Amator

    Amator Well-Known Member

    Messages:
    1,424
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #2
    Amator, Mar 25, 2010 IP
  3. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #3
    But I don't have Telnet or Putty access.
     
    kolucoms6, Mar 25, 2010 IP