Bitcoin Forum
June 14, 2024, 09:28:43 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Block Country From My Faucet  (Read 251 times)
bassdude (OP)
Legendary
*
Offline Offline

Activity: 1120
Merit: 1000



View Profile WWW
May 25, 2016, 08:37:13 PM
 #1

hi guys. I remember seeing somewhere there was a little php snippet of code that blocks entire county but i have not been able to find it again, anyone know got a link to it please?
felicita
Legendary
*
Offline Offline

Activity: 1582
Merit: 1031



View Profile
May 25, 2016, 09:42:06 PM
 #2

you can easly block em by Country !
if your are a litte proofed in php this should be no problem !

this i only tipped here not testet !!
Code:

function checkVisitor($ip){
$query = @unserialize(file_get_contents('http://ip-api.com/php/'.$ip));
if($query && $query['status'] == 'success') {
if(strpos($query['country'],'Ukraine')!==false) { return true; }
} else { return false;}
}


if you need some help call me Wink

kind regards
bassdude (OP)
Legendary
*
Offline Offline

Activity: 1120
Merit: 1000



View Profile WWW
May 26, 2016, 12:09:56 AM
 #3

you can easly block em by Country !
if your are a litte proofed in php this should be no problem !

this i only tipped here not testet !!
Code:

function checkVisitor($ip){
$query = @unserialize(file_get_contents('http://ip-api.com/php/'.$ip));
if($query && $query['status'] == 'success') {
if(strpos($query['country'],'Ukraine')!==false) { return true; }
} else { return false;}
}


if you need some help call me Wink

kind regards

cool thanks. thats close to the one i was looking for. il give it a go see what happens
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!