Simple yet powerful tool to allow access from your country only 1.1

now you can restrict acceessto your webidsite except only your country

  1. just avoid extra lookup to save recource

    kslakhani
    geoPlugin free tool is limited to 120 lookups per minute.
    To avoid extra lookups just added few lines
    just replace
    PHP:
    if (!isset($_SESSION['countrycode']) || empty($_SESSION['countrycode'])) {

    $_SESSION['countrycode'] = (string)getUserCountry();
    }
    if (
    $_SESSION['countrycode'] != "IN") { // just change your country code like US, UK, NZ, IN for complete list visit https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

    echo "<p>only visitors from my country can access this website</P><p> for more...