Bitcoin Forum

Economy => Micro Earnings => Topic started by: bassdude on May 25, 2016, 08:37:13 PM



Title: Block Country From My Faucet
Post by: bassdude on May 25, 2016, 08:37:13 PM
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?


Title: Re: Block Country From My Faucet
Post by: felicita on May 25, 2016, 09:42:06 PM
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 ;)

kind regards


Title: Re: Block Country From My Faucet
Post by: bassdude on May 26, 2016, 12:09:56 AM
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 ;)

kind regards

cool thanks. thats close to the one i was looking for. il give it a go see what happens