Pages:
Author

Topic: FaucetBOX.com Discussion - page 73. (Read 237001 times)

sr. member
Activity: 350
Merit: 250
January 14, 2016, 08:11:20 AM
Thank you, unfortunately it didn't I, an error left me something like invalid parameters
That's strange. Would you mind giving me the full error you are given, as well as what this function returns - var_dump($rewards);

I suspect there is some javascript you can put into the url to bypass validation? Any help?
It probably depends on how your faucet is coded, but no javascript should be able to get around a captcha AFAIK.
I think that I'm going to stop as well, right now I have a lot of traffic.
Thank you very much friend.
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
January 14, 2016, 07:59:39 AM
Thank you, unfortunately it didn't I, an error left me something like invalid parameters
That's strange. Would you mind giving me the full error you are given, as well as what this function returns - var_dump($rewards);

I suspect there is some javascript you can put into the url to bypass validation? Any help?
It probably depends on how your faucet is coded, but no javascript should be able to get around a captcha AFAIK.
hero member
Activity: 1218
Merit: 534
January 14, 2016, 07:22:08 AM
ok so I suspected a bad bot problem so I started rewarding 1-2 satoshi. I expected people to stop wasting their time only to be rewarded with such a little amount, other than the bots.  So today so far 14/01 I've had 3886 claims!



I suspect there is some javascript you can put into the url to bypass validation? Any help?

Of course you did lookup all the IPs, right?

Could you paste some of the IPs here? Thanks.
hero member
Activity: 603
Merit: 500
January 14, 2016, 06:40:14 AM
ok so I suspected a bad bot problem so I started rewarding 1-2 satoshi. I expected people to stop wasting their time only to be rewarded with such a little amount, other than the bots.  So today so far 14/01 I've had 3886 claims!



I suspect there is some javascript you can put into the url to bypass validation? Any help?
sr. member
Activity: 350
Merit: 250
January 13, 2016, 07:44:50 PM
Thank you very much, and for example for that reward is see on the web? I mean that if someone comes from a country you see the reward that will win
Oops, I forgot about that. In order to have it display them properly you would need to move some things around, but it still isn't that difficult.

So, at line 2218 on your index.php we're going to get the user's country and such. Put this code there:
Code:
//This code determines the reward
$countryCode = json_decode(file_get_contents('http://freegeoip.net/json/' . getIP()))->country_code;

$rewardMultiplier = 1;

if($countryCode == 'GB'){
$rewardMultiplier = 1.1;
}
Rather than times everything individually, we're going to create a multiplier variable to times everything by.
Also, I noticed that I used 0.1 rather than 1.1 in my previous example. This would give 10% of the expected reward rather than 110%, so unless you want to decrease the reward the multiplier should always be greater than 1.

After this, at line 2232 (before if(count($rewards) > 1) {) add this code:
Code:
foreach($rewards as $rW){
$rW *= $rewardMultiplier;
$newRewards[] = $rW;
}
$rewards = $newRewards;
If I am right this will get every reward from the array and times it by the multiplier (therefore 1.1 (110%) if the user is in GB). I would appreciate if someone else could check this first before anyone puts it into any live code though, since I am prone to making mistakes when coding directly into BitcoinTalk.
 
After this, be sure to revert the changes at line 2310 to this:
Code:
} else {
$ret = $fb->send($address, $reward);
}
Else the user will get the amount multiplied by more than you want, costing you money.

My apologies for not getting the code right the first time, I hope it didn't cause you any issues.



So, changing the $display_errors to true didn't return anything (as far as I can tell) and have the dbhost literally as "localhost" as shown below. Still getting the error.

snip
Are you adding your cPanel name to the beginning of your user and name as described here? It should look like this:

$dbhost = "localhost";
$dbuser = "cPanelName_Nick";
$dbpass = "Password";
$dbname = "cPanelName_DogeFaucet";


Thank you, unfortunately it didn't I, an error left me something like invalid parameters
full member
Activity: 140
Merit: 100
January 13, 2016, 06:56:21 PM
Thank you very much, and for example for that reward is see on the web? I mean that if someone comes from a country you see the reward that will win
Oops, I forgot about that. In order to have it display them properly you would need to move some things around, but it still isn't that difficult.

So, at line 2218 on your index.php we're going to get the user's country and such. Put this code there:
Code:
//This code determines the reward
$countryCode = json_decode(file_get_contents('http://freegeoip.net/json/' . getIP()))->country_code;

$rewardMultiplier = 1;

if($countryCode == 'GB'){
$rewardMultiplier = 1.1;
}
Rather than times everything individually, we're going to create a multiplier variable to times everything by.
Also, I noticed that I used 0.1 rather than 1.1 in my previous example. This would give 10% of the expected reward rather than 110%, so unless you want to decrease the reward the multiplier should always be greater than 1.

After this, at line 2232 (before if(count($rewards) > 1) {) add this code:
Code:
foreach($rewards as $rW){
$rW *= $rewardMultiplier;
$newRewards[] = $rW;
}
$rewards = $newRewards;
If I am right this will get every reward from the array and times it by the multiplier (therefore 1.1 (110%) if the user is in GB). I would appreciate if someone else could check this first before anyone puts it into any live code though, since I am prone to making mistakes when coding directly into BitcoinTalk.
 
After this, be sure to revert the changes at line 2310 to this:
Code:
} else {
$ret = $fb->send($address, $reward);
}
Else the user will get the amount multiplied by more than you want, costing you money.

My apologies for not getting the code right the first time, I hope it didn't cause you any issues.



So, changing the $display_errors to true didn't return anything (as far as I can tell) and have the dbhost literally as "localhost" as shown below. Still getting the error.

snip
Are you adding your cPanel name to the beginning of your user and name as described here? It should look like this:

$dbhost = "localhost";
$dbuser = "cPanelName_Nick";
$dbpass = "Password";
$dbname = "cPanelName_DogeFaucet";



Yes I am. It does look like that just wasn't sure if I could share exactly what I have there or not, but it does look like that.
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
January 13, 2016, 05:38:04 PM
Thank you very much, and for example for that reward is see on the web? I mean that if someone comes from a country you see the reward that will win
Oops, I forgot about that. In order to have it display them properly you would need to move some things around, but it still isn't that difficult.

So, at line 2218 on your index.php we're going to get the user's country and such. Put this code there:
Code:
//This code determines the reward
$countryCode = json_decode(file_get_contents('http://freegeoip.net/json/' . getIP()))->country_code;

$rewardMultiplier = 1;

if($countryCode == 'GB'){
$rewardMultiplier = 1.1;
}
Rather than times everything individually, we're going to create a multiplier variable to times everything by.
Also, I noticed that I used 0.1 rather than 1.1 in my previous example. This would give 10% of the expected reward rather than 110%, so unless you want to decrease the reward the multiplier should always be greater than 1.

After this, at line 2232 (before if(count($rewards) > 1) {) add this code:
Code:
foreach($rewards as $rW){
$rW *= $rewardMultiplier;
$newRewards[] = $rW;
}
$rewards = $newRewards;
If I am right this will get every reward from the array and times it by the multiplier (therefore 1.1 (110%) if the user is in GB). I would appreciate if someone else could check this first before anyone puts it into any live code though, since I am prone to making mistakes when coding directly into BitcoinTalk.
 
After this, be sure to revert the changes at line 2310 to this:
Code:
} else {
$ret = $fb->send($address, $reward);
}
Else the user will get the amount multiplied by more than you want, costing you money.

My apologies for not getting the code right the first time, I hope it didn't cause you any issues.



So, changing the $display_errors to true didn't return anything (as far as I can tell) and have the dbhost literally as "localhost" as shown below. Still getting the error.

snip
Are you adding your cPanel name to the beginning of your user and name as described here? It should look like this:

$dbhost = "localhost";
$dbuser = "cPanelName_Nick";
$dbpass = "Password";
$dbname = "cPanelName_DogeFaucet";

full member
Activity: 140
Merit: 100
January 13, 2016, 05:16:45 PM
OK so can anyone help me out? I'm trying to set-up a faucet using a database from my hosting provider (bluehost.com) and when I set everything up it tells me that it "Can't connect to database. Check your config.php.". I've set up a faucet from my free hosting (hostinger.co.uk) and have gotten it to work. Anyone know what's different about bluehost?
It's likely the sql server you are pointing it to; different hosts have you point it to different places. I believe that Hostinger has you point it to mysql.hostinger.co.uk or something similar, where as BlueHost would want you to point it to 'localhost'.
If not, try setting $display_errors to true in your config.php and seeing if anything is returned.

So, changing the $display_errors to true didn't return anything (as far as I can tell) and have the dbhost literally as "localhost" as shown below. Still getting the error.

$dbhost = "localhost";
$dbuser = "Nick";
$dbpass = "Password";
$dbname = "DogeFaucet";
sr. member
Activity: 350
Merit: 250
January 13, 2016, 05:06:38 PM
Would it be friend as well?

Code:
snip
If it were there then it would send the coins before changing the reward making it useless. Place the $ret = $fb->send($address, $reward); below everything else, like so:
Code:
} else {
//This code determines the reward
$countryCode = json_decode(file_get_contents('http://freegeoip.net/json/' . getIP()))->country_code;
if($countryCode == 'GB'){
$reward *= 0.1;
}

//This code sends the reward
$ret = $fb->send($address, $reward);
}
Thank you very much, and for example for that reward is see on the web? I mean that if someone comes from a country you see the reward that will win
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
January 13, 2016, 05:04:56 PM
OK so can anyone help me out? I'm trying to set-up a faucet using a database from my hosting provider (bluehost.com) and when I set everything up it tells me that it "Can't connect to database. Check your config.php.". I've set up a faucet from my free hosting (hostinger.co.uk) and have gotten it to work. Anyone know what's different about bluehost?
It's likely the sql server you are pointing it to; different hosts have you point it to different places. I believe that Hostinger has you point it to mysql.hostinger.co.uk or something similar, where as BlueHost would want you to point it to 'localhost'.
If not, try setting $display_errors to true in your config.php and seeing if anything is returned.
full member
Activity: 140
Merit: 100
January 13, 2016, 04:56:32 PM
OK so can anyone help me out? I'm trying to set-up a faucet using a database from my hosting provider (bluehost.com) and when I set everything up it tells me that it "Can't connect to database. Check your config.php.". I've set up a faucet from my free hosting (hostinger.co.uk) and have gotten it to work. Anyone know what's different about bluehost?
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
January 13, 2016, 02:15:20 PM
Would it be friend as well?

Code:
snip
If it were there then it would send the coins before changing the reward making it useless. Place the $ret = $fb->send($address, $reward); below everything else, like so:
Code:
} else {
//This code determines the reward
$countryCode = json_decode(file_get_contents('http://freegeoip.net/json/' . getIP()))->country_code;
if($countryCode == 'GB'){
$reward *= 0.1;
}

//This code sends the reward
$ret = $fb->send($address, $reward);
}
sr. member
Activity: 350
Merit: 250
January 13, 2016, 01:13:08 PM
Kazuldur How to set different rewards for different countries?
That requires a bit of extra modification to the FaucetBox file, but it isn't difficult. Personally I think the easiest way to do it would be by using a geoip API, however this may be inaccurate. The API that I'll be using in this example is freegeoip. This API has a limit of 10,000 requests per hour, so I can't imagine it would reach the cap for a faucet. Code is untested as always.

On line 2309 in index.php add this code to get the country code, since it's easier to use:
Code:
$countryCode = json_decode(file_get_contents('http://freegeoip.net/json/' . getIP()))->country_code;
This will return the user's country code in ISO form, for example GB for United Kingdom.

You can then just check the country code before sending the reward and adjust the amount, for example:
Code:
if($countryCode == 'GB'){
     $reward *= 0.1;
}
This code would increase the amount given to any user in the United Kingdom by 10% (or the multiplier of 0.1). You could obviously go into detail a lot with this, but I'm not going to because the rest is self explanatory.

Another way that this could be done would be by using the geoip_country_by_name in PHP's geoip framework, however this framework may not be available to the majority of hosting users due to it having to usually be installed separately to PHP.

If you're using this though, you could probably just replace the first line of code with:
Code:
$countryCode = geoip_get_country_by_name($hostnames->hostnames);
And it would likely return the same result.

Lol... So you would give people less or more satoshi based on the country they live in? What does the "cost of living" have to do with anything? I'm not seeing it.
I believe that some faucets use it to adjust rates due to advertising income. For countries such as Russia and Ukraine which bring in less money they get smaller rewards than countries like the US and UK which bring in more advertising revenue.

We know that life is more expensive in some countries than in others, how is it possible that you have not yet implemented this in the script?
Since it requires an external API to be used, or more server usage on a service like NastyHosts, and I can't imagine it would be too easy to make a UI which would work well for a faucet owner to change countries' rewards. That and it could probably be abused by users using VPNs and Proxies to get larger rewards.
Would it be friend as well?

Code:
} else {
                    $ret = $fb->send($address, $reward);
$countryCode = json_decode(file_get_contents('http://freegeoip.net/json/' . getIP()))->country_code;
if($countryCode == 'GB'){
     $reward *= 0.1;
}
                }
legendary
Activity: 971
Merit: 1000
January 13, 2016, 11:45:22 AM
Hey, for some reason it says that www.FaucetGame.com is "Possibly Broken" for some reason?



It's been up 99.99% of the time, there are funds inside of the wallet.
I don't see what's wrong?

It also can get delisted if it returns any http error. It'll get back up soon.

I can't run my faucet (I get a white page after claim), neither can I login to my admin page (then I also get a white page)
I have a way around when I use the absolute URL, but that's not the URL I want my visitors to use.

My faucet now goes via Cloudflare, is there anything I need to change?
Security in my Cloudflare settings is "flexible"

Nastyhosts blocks cloudflare if you don't configure it properly in your faucet's admin panel. Use your "absolute URL" (it's a problem that's possible, it leaves you vulnerable), login to admin panel and read everything on the "Advanced" tab. If you don't understand what's written it, it's safer for you to not use CloudFlare.
hero member
Activity: 868
Merit: 500
January 13, 2016, 11:33:33 AM
Kazuldur How to set different rewards for different countries?
That requires a bit of extra modification to the FaucetBox file, but it isn't difficult. Personally I think the easiest way to do it would be by using a geoip API, however this may be inaccurate. The API that I'll be using in this example is freegeoip. This API has a limit of 10,000 requests per hour, so I can't imagine it would reach the cap for a faucet. Code is untested as always.

On line 2309 in index.php add this code to get the country code, since it's easier to use:
Code:
$countryCode = json_decode(file_get_contents('http://freegeoip.net/json/' . getIP()))->country_code;
This will return the user's country code in ISO form, for example GB for United Kingdom.

You can then just check the country code before sending the reward and adjust the amount, for example:
Code:
if($countryCode == 'GB'){
     $reward *= 0.1;
}
This code would increase the amount given to any user in the United Kingdom by 10% (or the multiplier of 0.1). You could obviously go into detail a lot with this, but I'm not going to because the rest is self explanatory.

Another way that this could be done would be by using the geoip_country_by_name in PHP's geoip framework, however this framework may not be available to the majority of hosting users due to it having to usually be installed separately to PHP.

If you're using this though, you could probably just replace the first line of code with:
Code:
$countryCode = geoip_get_country_by_name($hostnames->hostnames);
And it would likely return the same result.

Lol... So you would give people less or more satoshi based on the country they live in? What does the "cost of living" have to do with anything? I'm not seeing it.
I believe that some faucets use it to adjust rates due to advertising income. For countries such as Russia and Ukraine which bring in less money they get smaller rewards than countries like the US and UK which bring in more advertising revenue.

We know that life is more expensive in some countries than in others, how is it possible that you have not yet implemented this in the script?
Since it requires an external API to be used, or more server usage on a service like NastyHosts, and I can't imagine it would be too easy to make a UI which would work well for a faucet owner to change countries' rewards. That and it could probably be abused by users using VPNs and Proxies to get larger rewards.
Thanks for this tutorial I was looking for this.
hero member
Activity: 1218
Merit: 534
January 13, 2016, 10:23:50 AM
I have used this one in the past. Was always happy to use it.
http://lite.ip2location.com
sr. member
Activity: 350
Merit: 250
January 13, 2016, 10:15:44 AM
Kazuldur How to set different rewards for different countries?
That requires a bit of extra modification to the FaucetBox file, but it isn't difficult. Personally I think the easiest way to do it would be by using a geoip API, however this may be inaccurate. The API that I'll be using in this example is freegeoip. This API has a limit of 10,000 requests per hour, so I can't imagine it would reach the cap for a faucet. Code is untested as always.

On line 2309 in index.php add this code to get the country code, since it's easier to use:
Code:
$countryCode = json_decode(file_get_contents('http://freegeoip.net/json/' . getIP()))->country_code;
This will return the user's country code in ISO form, for example GB for United Kingdom.

You can then just check the country code before sending the reward and adjust the amount, for example:
Code:
if($countryCode == 'GB'){
     $reward *= 0.1;
}
This code would increase the amount given to any user in the United Kingdom by 10% (or the multiplier of 0.1). You could obviously go into detail a lot with this, but I'm not going to because the rest is self explanatory.

Another way that this could be done would be by using the geoip_country_by_name in PHP's geoip framework, however this framework may not be available to the majority of hosting users due to it having to usually be installed separately to PHP.

If you're using this though, you could probably just replace the first line of code with:
Code:
$countryCode = geoip_get_country_by_name($hostnames->hostnames);
And it would likely return the same result.

Lol... So you would give people less or more satoshi based on the country they live in? What does the "cost of living" have to do with anything? I'm not seeing it.
I believe that some faucets use it to adjust rates due to advertising income. For countries such as Russia and Ukraine which bring in less money they get smaller rewards than countries like the US and UK which bring in more advertising revenue.

We know that life is more expensive in some countries than in others, how is it possible that you have not yet implemented this in the script?
Since it requires an external API to be used, or more server usage on a service like NastyHosts, and I can't imagine it would be too easy to make a UI which would work well for a faucet owner to change countries' rewards. That and it could probably be abused by users using VPNs and Proxies to get larger rewards.
Genius thank you very much, I will check
hero member
Activity: 1218
Merit: 534
January 13, 2016, 10:12:25 AM
I believe that some faucets use it to adjust rates due to advertising income. For countries such as Russia and Ukraine which bring in less money they get smaller rewards than countries like the US and UK which bring in more advertising revenue.


Oh ok, now I understand.

Thanks for sharing your tips/code.
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
January 13, 2016, 10:10:32 AM
Kazuldur How to set different rewards for different countries?
That requires a bit of extra modification to the FaucetBox file, but it isn't difficult. Personally I think the easiest way to do it would be by using a geoip API, however this may be inaccurate. The API that I'll be using in this example is freegeoip. This API has a limit of 10,000 requests per hour, so I can't imagine it would reach the cap for a faucet. Code is untested as always.

On line 2309 in index.php add this code to get the country code, since it's easier to use:
Code:
$countryCode = json_decode(file_get_contents('http://freegeoip.net/json/' . getIP()))->country_code;
This will return the user's country code in ISO form, for example GB for United Kingdom.

You can then just check the country code before sending the reward and adjust the amount, for example:
Code:
if($countryCode == 'GB'){
     $reward *= 0.1;
}
This code would increase the amount given to any user in the United Kingdom by 10% (or the multiplier of 0.1). You could obviously go into detail a lot with this, but I'm not going to because the rest is self explanatory.

Another way that this could be done would be by using the geoip_country_by_name in PHP's geoip framework, however this framework may not be available to the majority of hosting users due to it having to usually be installed separately to PHP.

If you're using this though, you could probably just replace the first line of code with:
Code:
$countryCode = geoip_get_country_by_name($hostnames->hostnames);
And it would likely return the same result.

Lol... So you would give people less or more satoshi based on the country they live in? What does the "cost of living" have to do with anything? I'm not seeing it.
I believe that some faucets use it to adjust rates due to advertising income. For countries such as Russia and Ukraine which bring in less money they get smaller rewards than countries like the US and UK which bring in more advertising revenue.

We know that life is more expensive in some countries than in others, how is it possible that you have not yet implemented this in the script?
Since it requires an external API to be used, or more server usage on a service like NastyHosts, and I can't imagine it would be too easy to make a UI which would work well for a faucet owner to change countries' rewards. That and it could probably be abused by users using VPNs and Proxies to get larger rewards.
sr. member
Activity: 350
Merit: 250
January 13, 2016, 10:04:21 AM
We know that life is more expensive in some countries than in others, how is it possible that you have not yet implemented this in the script?


Lol... So you would give people less or more satoshi based on the country they live in? What does the "cost of living" have to do with anything? I'm not seeing it.
That country is you?
What is the base salary?
etc etc etc
Pages:
Jump to: