Author

Topic: Help needed, Bitcoind & PHP (Read 1609 times)

hero member
Activity: 576
Merit: 514
June 12, 2012, 01:01:32 PM
#6
Quote
Notices on or off, they will be back in the forums for help anyway.

Is asking for help a bad thing then?
Asking for help is a good thing, especially if the person learns from it. But don't shoot yourself in both knees by trying to save some time by being lazy.

Suggesting that a problem doesn't exist anymore simply because error notices are turned off is not a good thing.
Just like the train that still will hit you, even though you closed your eyes and don't see it coming.

Code should not produce errors/warnings/notices when "operating normally". Usually it's a simple error like in this case and easy to fix.
If you don't fix it, you'll miss the more serious errors simply because of the size of the error log.
If you turn error messages off, you'll miss every chance to fix an error before it blows up right into your face.
hero member
Activity: 576
Merit: 514
June 12, 2012, 12:08:25 PM
#5
Quote
You can turn off PHP error notices with 'error_reporting(E_ALL ^ E_NOTICE);' if you wish.
Which is done by "developers" who later end up in forums asking "HALP my site got ownzored n I dunno why lolz"
full member
Activity: 126
Merit: 100
June 09, 2012, 09:47:59 PM
#4
Glad to help.  Smiley
sr. member
Activity: 294
Merit: 250
June 09, 2012, 09:46:57 PM
#3
Perfect, thanks unfinishe. Working great now.
full member
Activity: 126
Merit: 100
June 09, 2012, 08:14:26 PM
#2
You're using what PHP assumes are constant variable names rather than strings as keys to access the hash returned by $bitcoin.

So, for example, you need to change:
Code:
$detail[time]
to
Code:
$detail['time']

The notices are just letting you know that because the code didn't work the way it's written (since the variable time is undefined), it assumed that you really meant to put strings there.
sr. member
Activity: 294
Merit: 250
June 09, 2012, 06:07:33 PM
#1
Hi everybody,
I threw together a quick PHP interface so I could view recent transactions, addresses, etc. without SSHing in every time. I noticed that nginx had prepared a nice 14GB error log file for me, consisting of this:
Quote
2012/06/09 19:03:44 [error] 4455#0: *22 FastCGI sent in stderr: "PHP Notice:  Use of undefined constant paytxfee - assumed 'paytxfee' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on $
PHP Notice:  Use of undefined constant balance - assumed 'balance' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 49
PHP Notice:  Use of undefined constant blocks - assumed 'blocks' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 49
PHP Notice:  Use of undefined constant connections - assumed 'connections' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 49
PHP Notice:  Use of undefined constant category - assumed 'category' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 67
PHP Notice:  Use of undefined constant time - assumed 'time' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 73
PHP Notice:  Use of undefined constant amount - assumed 'amount' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 74
PHP Notice:  Use of undefined constant confirmations - assumed 'confirmations' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 75
PHP Notice:  Use of undefined constant address - assumed 'address' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 76
PHP Notice:  Use of undefined constant txid - assumed 'txid' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 77
PHP Notice:  Use of undefined constant category - assumed 'category' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 67
PHP Notice:  Use of undefined constant time - assumed 'time' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 73
PHP Notice:  Use of undefined constant amount - assumed 'amount' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 74
PHP Notice:  Use of undefined constant confirmations - assumed 'confirmations' in /srv/www/www.tehzomb.info/public_html/bitcoind/index.php on line 75
PHP Notice:  Use of undefined consta
You get the idea. Here's my code, can anybody tell me what is wrong?

Thanks a million.
Jump to: