Re: where else can this list be found? [message #170644 is a reply to message #170639] |
Sat, 13 November 2010 02:50 |
Mike S
Messages: 8 Registered: September 2010
Karma:
|
Junior Member |
|
|
On 11/12/2010 1:57 PM, richard wrote:
> http://krakjoe.com/geoip/query=code&address=remote
>
> I found this code I would like to use as a spam blocker.
> Since it calls the information from a file rather than an array.
> I could make up my own file to install on my site.
> I just need to know where I can get the same basic information as this site
> is apparently gone.
>
> <?php
> # array of country codes you wanna block
> $block_countries = array(
> 'GB',
> 'US'
> );
> # grab the country code from krakjoe.com
> if( !in_array( file_get_contents(
> 'http://krakjoe.com/geoip/query=code&address=remote' ), $block_countries )
> ) :
> # the following page will only be displayed to users who have a country
> code that is NOT in the array at the top of the example
> ?>
> <html>
> <head>
> <title>You're allowed to view this page</title>
> </head>
> <body>
> viewing the page, oh yeah baby .....
> </body>
> </html>
> <?php
> endif;
> ?>
>
>
> I would change the !in_array to in_array then send those blocked to a
> specific page before they even get into my forum site.
Will these get you started: 2 pages with easy to grab data, and the
wikipedia page about it:
English country names and code elements
This list states the country names (official short names in English) in
alphabetical order as given in ISO 3166-1 and the corresponding ISO
3166-1-alpha-2 code elements.
This list is updated whenever a change to the official code list in ISO
3166-1 is effected by the ISO 3166/MA.
It lists 246 official short names and code elements.
http://www.iso.org/iso/english_country_names_and_code_elements
-----------------------------------------------------------------------
Country Codes
The International Organization for Standardization (ISO) under its
standard ISO 3166 has established two-letter (2-alpha) and three-letter
(3-alpha) codes for the various countries of the world, including
independent states, dependent areas, and certain areas of contested
jurisdiction or special status. These codes are published and revised
when needed by the ISO 3166 Maintenance Agency.
http://www.unc.edu/~rowlett/units/codes/country.htm
-----------------------------------------------------------------------
ISO 3166-1 alpha-2
ISO 3166-1 alpha-2 codes are two-letter country codes defined in ISO
3166-1, part of the ISO 3166 standard published by the International
Organization for Standardization (ISO), to represent countries,
dependent territories, and special areas of geographical interest. They
are the most widely used of the country codes published by ISO (the
others being alpha-3 and numeric), and are used most prominently for the
Internet's country code top-level domains (with a few exceptions).[1]
They were first included as part of the ISO 3166 standard in its first
edition in 1974
http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
|