FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » where else can this list be found?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
where else can this list be found? [message #170639] Fri, 12 November 2010 21:57 Go to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
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.
Re: where else can this list be found? [message #170644 is a reply to message #170639] Sat, 13 November 2010 02:50 Go to previous messageGo to next message
Mike S is currently offline  Mike S
Messages: 8
Registered: September 2010
Karma: 0
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
Re: where else can this list be found? [message #170646 is a reply to message #170644] Sat, 13 November 2010 03:38 Go to previous messageGo to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
On Fri, 12 Nov 2010 18:50:09 -0800, Mike S wrote:

> 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

Perhaps I should ask, how could I resolve an IP to a country code?

In my forum, I recently revamped my spammer IP list and wound up with
basically 50 main ip's that cover what I don't want in.
Problem is, the way it is set up, the IP block doesn't take effect until
the visitor does something, such as trying to register.
What I want to do is to check the IP from the beginning, and if it's on the
list, kick them off to another page.

I've seen a few sites that show how to do this but none show how to do it
with a wildcard scheme. With this script, using the external file would
help a lot.

Got any sites that would show how to use the wildcard scheme properly?
Re: where else can this list be found? [message #170647 is a reply to message #170646] Sat, 13 November 2010 04:05 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 11/12/2010 10:38 PM, richard wrote:
> On Fri, 12 Nov 2010 18:50:09 -0800, Mike S wrote:
>
>> 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
>
> Perhaps I should ask, how could I resolve an IP to a country code?
>
> In my forum, I recently revamped my spammer IP list and wound up with
> basically 50 main ip's that cover what I don't want in.
> Problem is, the way it is set up, the IP block doesn't take effect until
> the visitor does something, such as trying to register.
> What I want to do is to check the IP from the beginning, and if it's on the
> list, kick them off to another page.
>
> I've seen a few sites that show how to do this but none show how to do it
> with a wildcard scheme. With this script, using the external file would
> help a lot.
>
> Got any sites that would show how to use the wildcard scheme properly?

Not reliably, and such tricks are very easy to get around. With a few
minutes of looking, I can access your site from a lot of different
countries - or so your site things.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: where else can this list be found? [message #170649 is a reply to message #170646] Sat, 13 November 2010 04:14 Go to previous messageGo to next message
Mike S is currently offline  Mike S
Messages: 8
Registered: September 2010
Karma: 0
Junior Member
On 11/12/2010 7:38 PM, richard wrote:
> On Fri, 12 Nov 2010 18:50:09 -0800, Mike S wrote:
>
>> 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
>
> Perhaps I should ask, how could I resolve an IP to a country code?
>
> In my forum, I recently revamped my spammer IP list and wound up with
> basically 50 main ip's that cover what I don't want in.
> Problem is, the way it is set up, the IP block doesn't take effect until
> the visitor does something, such as trying to register.
> What I want to do is to check the IP from the beginning, and if it's on the
> list, kick them off to another page.
>
> I've seen a few sites that show how to do this but none show how to do it
> with a wildcard scheme. With this script, using the external file would
> help a lot.
>
> Got any sites that would show how to use the wildcard scheme properly?

There are free databases to get a country code from an IP e.g.

http://software77.net/geo-ip/
Re: where else can this list be found? [message #170650 is a reply to message #170649] Sat, 13 November 2010 06:10 Go to previous messageGo to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
On Fri, 12 Nov 2010 20:14:55 -0800, Mike S wrote:

> On 11/12/2010 7:38 PM, richard wrote:
>> On Fri, 12 Nov 2010 18:50:09 -0800, Mike S wrote:
>>
>>> 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
>>
>> Perhaps I should ask, how could I resolve an IP to a country code?
>>
>> In my forum, I recently revamped my spammer IP list and wound up with
>> basically 50 main ip's that cover what I don't want in.
>> Problem is, the way it is set up, the IP block doesn't take effect until
>> the visitor does something, such as trying to register.
>> What I want to do is to check the IP from the beginning, and if it's on the
>> list, kick them off to another page.
>>
>> I've seen a few sites that show how to do this but none show how to do it
>> with a wildcard scheme. With this script, using the external file would
>> help a lot.
>>
>> Got any sites that would show how to use the wildcard scheme properly?
>
> There are free databases to get a country code from an IP e.g.
>
> http://software77.net/geo-ip/

That's what I used to build my IP list with. Gives a bit more info than
other sites do.
Re: where else can this list be found? [message #170653 is a reply to message #170639] Sat, 13 November 2010 12:38 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
On Nov 12, 9:57 pm, richard <mem...@newsguy.com> 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.

Sorry mate but you can't.

It simply will not work. Folks who send spam have many ways to make it
look like they are coming from another country.

Code if if you want to, but you'll really be wasting your time.
Re: where else can this list be found? [message #170657 is a reply to message #170639] Sun, 14 November 2010 00:28 Go to previous message
Mike S is currently offline  Mike S
Messages: 8
Registered: September 2010
Karma: 0
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.

<snip>
Is the spam being sent in form mail? How exactly is the spam being entered?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Why don't I get a deprecation warning?
Next Topic: Variable expansion <?=$foo?> not working anymore
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 10:48:26 GMT 2024

Total time taken to generate the page: 0.02299 seconds