Need Block some country

Discussion in 'PHP' started by muts, Apr 16, 2009.

  1. #1
    hello , I am looking for any script allowed to me to block some country user from my site ,


    I will pay for this


    thanks
     
    muts, Apr 16, 2009 IP
  2. Dennis M.

    Dennis M. Active Member

    Messages:
    119
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    You want to block a user or an entire country? :)

    Regards,
    Dennis M.
     
    Dennis M., Apr 16, 2009 IP
  3. muts

    muts Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I want block the all country users , for Example any IP coming from U.S.A Will not view my site , like that
     
    muts, Apr 16, 2009 IP
  4. Dennis M.

    Dennis M. Active Member

    Messages:
    119
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #4
    Ah ok. Well, you would need ranges. If you need something different I can program it to you, I'll just need specifically what you need then I can quote you. However, http://blockacountry.com is free. It's very simple. Select countries you wish to block, put in your email, copy/paste the code they provide into your .htaccess file.

    Regards,
    Dennis M.
     
    Dennis M., Apr 16, 2009 IP
  5. muts

    muts Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5

    I test this But its not working , I choice U.S.A and i copy all the Proxy and i past in my .htaccess file and i log in to my server in U.S.A and he open my site ,

    So can you provide me something like this and working ?
     
    muts, Apr 16, 2009 IP
  6. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #6
    Bohra, Apr 16, 2009 IP
  7. bpasc95

    bpasc95 Active Member

    Messages:
    196
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    70
    #7
    Are you on a dedicated server, or shared? If you are on a dedicated server, you can build the Maxmind GeoIP into Apache the use .htaccess to redirect as needed.
     
    bpasc95, Apr 16, 2009 IP
  8. atlantaazfinest

    atlantaazfinest Peon

    Messages:
    389
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Just coded it in the submit box didn't have time to check it should work... might need some tweaking.

    <?
    $ip = $_SERVER['REMOTE_ADDR'];
    $page = file_get_contents("http://api.hostip.info/country.php?ip=".$ip);
    if(preg_match('/US/',$page))
    {
    header("Location: http://google.com");
    exit();
    }
    else
    {
    echo "enter site";
    }
    ?>
    PHP:
     
    atlantaazfinest, Apr 17, 2009 IP