Pages:
Author

Topic: LF> A very basic faucet coder (Read 2475 times)

legendary
Activity: 1094
Merit: 1006
July 10, 2013, 09:26:08 PM
#35
Seems you are having some trouble getting that stuff working. I could lease out my TRC Faucet code if you want.
hero member
Activity: 686
Merit: 504
always the student, never the master.
July 08, 2013, 08:25:50 PM
#34
PHP Version 5.4.4

hmm.. i thought i was runing 4.4 to but upon inspection i'm running 5.3.4
vip
Activity: 1316
Merit: 1043
👻
July 08, 2013, 07:57:26 PM
#33
PHP Version 5.4.4
hero member
Activity: 686
Merit: 504
always the student, never the master.
July 08, 2013, 07:54:37 PM
#32
mad that his code didn't work on php 5.5 the arrays for the ads are completely unnecessary anyway. what does it accomplish?

> Parse error: syntax error, unexpected '[' in /home/a2414827/public_html/config.php on line 21

This is a classic signature for an outdated PHP version that does not support the shorter array syntax format.

The ads are in an array so they can rotate.
oh. what version of php are you on?
vip
Activity: 1316
Merit: 1043
👻
July 08, 2013, 07:53:33 PM
#31
mad that his code didn't work on php 5.5 the arrays for the ads are completely unnecessary anyway. what does it accomplish?

> Parse error: syntax error, unexpected '[' in /home/a2414827/public_html/config.php on line 21

This is a classic signature for an outdated PHP version that does not support the shorter array syntax format.

The ads are in an array so they can rotate.
hero member
Activity: 686
Merit: 504
always the student, never the master.
July 08, 2013, 07:48:00 PM
#30
mad that his code didn't work on php 5.5 the arrays for the ads are completely unnecessary anyway. what does it accomplish?
vip
Activity: 1316
Merit: 1043
👻
July 08, 2013, 07:44:10 PM
#29
Just stop wasting people's time if you have nothing to talk about.

@DiamondCardz: Update your PHP version. If you're on shared hosting, ask them to upgrade / move you to a server that has the updated PHP version. Download the original script and it'll work, don't listen to the suggestions that will break the script.
vip
Activity: 1316
Merit: 1043
👻
July 08, 2013, 07:42:32 PM
#28
The code did not work because DiamondCardz was running it on an outdated PHP version. Update to the latest PHP version and the original version will work.

Your suggestion does not throw an error, however it breaks the script and people will not get any rewards.

You do not quote NUMBERS with strings.
hero member
Activity: 686
Merit: 504
always the student, never the master.
July 08, 2013, 07:40:29 PM
#27
no r3wt wtf?

NOT like that. You do not put quotes around arrays. Have you written a single line of PHP code before?

Seriously, WTF?

It should be this:

$rewards = [1000, 1250, 1500, 1750, 2000];

$bannerAds = [""];

WTF again.

you still have to quote the variables inside of the array. way to go on a tangeant for no reason. as to your last point(lines 52-55) the array is completely useless and unnecessary for these lines. a simple print or echo would have been much simpler, and still just as functional.
vip
Activity: 1316
Merit: 1043
👻
July 08, 2013, 07:37:40 PM
#26
no r3wt wtf?

NOT like that. You do not put quotes around arrays. Have you written a single line of PHP code before?

Seriously, WTF?

It should be this:

$rewards = [1000, 1250, 1500, 1750, 2000];

$bannerAds = [""];

WTF again.
hero member
Activity: 686
Merit: 504
always the student, never the master.
July 08, 2013, 02:49:13 PM
#25
 here you go replace line 55

Code:
$bannerAds = "[]";

as for the second error you will need to setup a mySQLi database and input the necessary values in to the array(s) for username host and password and/or port.
legendary
Activity: 1134
Merit: 1118
July 08, 2013, 02:42:54 PM
#24
Oh god, there is more.

Code:
Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/a2414827/public_html/config.php on line 56

Hmmm.

Code:
Warning: mysqli::mysqli() [mysqli.mysqli]: (28000/1045): Access denied for user 'username'@'localhost' (using password: YES) in /home/a2414827/public_html/config.php on line 10

^ That one is probably because I'm being retarded and not starting a MySQL database. I'm tired atm, will probably do it tomorrow.

Code:
SQL error: Access denied for user 'username'@'localhost' (using password: YES)

Refer to the above.
hero member
Activity: 686
Merit: 504
always the student, never the master.
July 08, 2013, 02:39:39 PM
#23
for future reference php will require you to use
Code:
'
instead of
Code:
"
for inner html/js inside of a php script 99% of the time.
hero member
Activity: 686
Merit: 504
always the student, never the master.
July 08, 2013, 02:36:52 PM
#22
That fixed it. Now we have what seems to be the final error:

Code:
Parse error: syntax error, unexpected '[' in /home/a2414827/public_html/config.php on line 51


replace lines 53-55 with this. just a minor syntax error

Code:
$squareAds = "['']";

$textAds = "['

CoinChat - get free Bitcoins chatting!

', '

Get your own faucet! MyFaucet PHP script - free!

']";

$bannerAds = "['']";
legendary
Activity: 1134
Merit: 1118
July 08, 2013, 02:31:50 PM
#21
That fixed it. Now we have what seems to be the final error:

Code:
Parse error: syntax error, unexpected '[' in /home/a2414827/public_html/config.php on line 51
hero member
Activity: 686
Merit: 504
always the student, never the master.
July 08, 2013, 02:28:00 PM
#20
try replacing line 21 with:

Code:
$rewards = "[1000, 1250, 1500, 1750, 2000]";
hero member
Activity: 686
Merit: 504
always the student, never the master.
July 08, 2013, 02:20:40 PM
#19
ok diamond cards. open config.php with a text editor and replace line 21 with this

Code:
$rewards = ['1000, 1500, 2000, 2500, 3000, 3500, 4000, 5000'];

Same error pops up.

BTW, my personal code is

Code:
$rewards = ['1000, 1250, 1500, 1750, 2000'];

Which is the same as what you posted, but with different numbers :L

ah, ok let me debug real quick.
legendary
Activity: 1134
Merit: 1118
July 08, 2013, 02:19:54 PM
#18
ok diamond cards. open config.php with a text editor and replace line 21 with this

Code:
$rewards = ['1000, 1500, 2000, 2500, 3000, 3500, 4000, 5000'];

Same error pops up.

BTW, my personal code is

Code:
$rewards = ['1000, 1250, 1500, 1750, 2000'];

Which is the same as what you posted, but with different numbers :L
hero member
Activity: 686
Merit: 504
always the student, never the master.
July 08, 2013, 02:17:45 PM
#17
ok diamond cards. open config.php with a text editor and replace line 21 with this

Code:
$rewards = ['1000, 1500, 2000, 2500, 3000, 3500, 4000, 5000'];

Thanks.

your welcome, if you encounter more errors let me know
legendary
Activity: 1134
Merit: 1118
July 08, 2013, 02:15:12 PM
#16
ok diamond cards. open config.php with a text editor and replace line 21 with this

Code:
$rewards = ['1000, 1500, 2000, 2500, 3000, 3500, 4000, 5000'];

Thanks.
Pages:
Jump to: