Bitcoin Forum
May 07, 2024, 12:07:20 PM
Welcome,
Guest
. Please
login
or
register
.
News
: Latest Bitcoin Core release:
27.0
[
Torrent
]
Home
Help
Search
Login
Register
More
Bitcoin Forum
>
Bitcoin
>
Bitcoin Technical Support
>
【SOLVED】PHP error help!
Pages: [
1
]
« previous topic
next topic »
Print
Author
Topic: 【SOLVED】PHP error help! (Read 1090 times)
maomao
(OP)
Member
Offline
Activity: 117
Merit: 10
Not only FUD :)
【SOLVED】PHP error help!
February 13, 2013, 03:25:40 AM
Last edit: February 13, 2013, 04:48:42 PM by maomao
#1
get this warning in my error logs and wanted to know how to correct this issues in my code.
Warning: PHP Notice: Undefined property: stdClass::$balance in script.php on line 33
$balance = $json->{'balance'} / 100000000; // line 33
quarkchain.io
In order to achieve higher forum ranks, you need both activity points and merit points.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715083640
Hero Member
Offline
Posts: 1715083640
Ignore
1715083640
1715083640
#2
1715083640
Report to moderator
1715083640
Hero Member
Offline
Posts: 1715083640
Ignore
1715083640
1715083640
#2
1715083640
Report to moderator
payb.tc
Hero Member
Offline
Activity: 812
Merit: 1000
Re: PHP error help!
February 13, 2013, 03:36:46 AM
#2
maomao, before line 33, can you
var_dump($json);
...if possible, pasting the whole script here might help.
BCB
CTG
VIP
Legendary
Offline
Activity: 1078
Merit: 1002
BCJ
Re: PHP error help!
February 13, 2013, 03:53:54 AM
#3
did you include the library you are referencing or is the path correct?
payb.tc
Hero Member
Offline
Activity: 812
Merit: 1000
Re: PHP error help!
February 13, 2013, 04:00:49 AM
#4
have you tried this by the way:
$balance = $json->balance / 100000000; // line 33
i'm not familiar with the script you're using... did you copy it from somewhere, or come up with that line yourself?
without further detail, it appears to me that the line you're using is looking inside the $json object for a property or method called $balance and then using the value of $balance to look for a further property or method of $json.
eg.
class jsonClass {
$balance = 'mybalancevar';
$mybalancevar = 33;
}
in this case, $json->{'balance'} would equal 33; while $json->balance would be a string: mybalancevar
maomao
(OP)
Member
Offline
Activity: 117
Merit: 10
Not only FUD :)
Re: PHP error help!
February 13, 2013, 06:16:14 AM
#5
function check_balance()
{
$jsonurl = "
https://blockchain.info/merchant/
".$GLOBALS['user']."/balance?password=".$GLOBALS['password'];
$json = file_get_contents($jsonurl,0,null,null);
$json = json_decode($json);
$balance = $json->balance/ 100000000;
return $balance;
}
quarkchain.io
payb.tc
Hero Member
Offline
Activity: 812
Merit: 1000
Re: PHP error help!
February 13, 2013, 09:19:37 AM
#6
Quote from: maomao on February 13, 2013, 06:16:14 AM
function check_balance()
{
$jsonurl = "
https://blockchain.info/merchant/
".$GLOBALS['user']."/balance?password=".$GLOBALS['password'];
$json = file_get_contents($jsonurl,0,null,null);
echo '<pre>$json = ' . $json . '<br/><br/>';
$json = json_decode($json);
print_r($json);
echo '</pre>';
$balance = $json->balance/ 100000000;
return $balance;
}
let's see what's in that $json var first, so we know why the balance thing is throwing an error
maomao
(OP)
Member
Offline
Activity: 117
Merit: 10
Not only FUD :)
Re: PHP error help!
February 13, 2013, 10:23:27 AM
#7
Thank you. The reason is that there are special characters in my password.
quarkchain.io
ingrownpocket
Legendary
Offline
Activity: 952
Merit: 1000
Re: 【SLOVED】PHP error help!
February 13, 2013, 10:30:42 AM
#8
Glad it was 【SLOVED】
Pages: [
1
]
Print
Bitcoin Forum
>
Bitcoin
>
Bitcoin Technical Support
>
【SOLVED】PHP error help!
« previous topic
next topic »
Jump to:
Please select a destination:
-----------------------------
Bitcoin
-----------------------------
=> Bitcoin Discussion
===> Legal
===> Press
===> Meetups
===> Important Announcements
=> Development & Technical Discussion
===> Wallet software
=====> Electrum
=====> Bitcoin Wallet for Android
=====> BitcoinJ
=====> Armory
=====> Mycelium
=====> Hardware wallets
=> Mining
===> Mining support
===> Pools
===> Mining software (miners)
===> Hardware
=====> Group buys
===> Mining speculation
=> Bitcoin Technical Support
=> Project Development
-----------------------------
Economy
-----------------------------
=> Economics
===> Speculation
=> Marketplace
===> Goods
=====> Computer hardware
=====> Digital goods
=======> Invites & Accounts
=====> Collectibles
===> Services
===> Currency exchange
===> Gambling
=====> Games and rounds
=====> Investor-based games
=====> Gambling discussion
===> Lending
=====> Long-term offers
===> Securities
===> Auctions
===> Service Announcements
=====> Micro Earnings
===> Service Discussion
=====> Web Wallets
=====> Exchanges
=> Trading Discussion
===> Scam Accusations
===> Reputation
-----------------------------
Other
-----------------------------
=> Meta
===> New forum software
===> Bitcoin Wiki
=> Politics & Society
=> Beginners & Help
=> Off-topic
=> Serious discussion
===> Ivory Tower
=> Archival
===> Корзина
===> CPU/GPU Bitcoin mining hardware
===> Chinese students
===> Obsolete (buying)
===> Obsolete (selling)
===> MultiBit
-----------------------------
Alternate cryptocurrencies
-----------------------------
=> Altcoin Discussion
=> Announcements (Altcoins)
===> Tokens (Altcoins)
=> Mining (Altcoins)
===> Pools (Altcoins)
=> Marketplace (Altcoins)
===> Service Announcements (Altcoins)
===> Service Discussion (Altcoins)
===> Bounties (Altcoins)
=> Speculation (Altcoins)
-----------------------------
Local
-----------------------------
=> العربية (Arabic)
===> العملات البديلة (Altcoins)
=====> النقاشات
===> إستفسارات و أسئلة المبتدئين
===> التعدين
===> النقاشات الأخرى
===> منصات التبادل
=> Bahasa Indonesia (Indonesian)
===> Marketplace (Bahasa Indonesia)
===> Mining (Bahasa Indonesia)
===> Altcoins (Bahasa Indonesia)
===> Trading dan Spekulasi
===> Ekonomi, Politik, dan Budaya
===> Topik Lainnya
=> Español (Spanish)
===> Mercado y Economía
=====> Servicios
=====> Trading y especulación
===> Hardware y Minería
===> Esquina Libre
===> Mercadillo
=====> Mexico
=====> Argentina
=====> España
=====> Centroamerica y Caribe
===> Primeros pasos y ayuda
===> Altcoins (criptomonedas alternativas)
=====> Minería de altcoins
=====> Servicios
=====> Tokens (Español)
=> 中文 (Chinese)
===> 跳蚤市场
===> 山寨币
===> 媒体
===> 挖矿
===> 离题万里
=> Hrvatski (Croatian)
===> Trgovina
===> Altcoins (Hrvatski)
=====> Announcements (Hrvatski)
===> Off-topic (Hrvatski)
=> Deutsch (German)
===> Anfänger und Hilfe
===> Mining (Deutsch)
===> Trading und Spekulation
===> Projektentwicklung
===> Off-Topic (Deutsch)
===> Treffen
===> Presse
===> Altcoins (Deutsch)
=====> Announcements (Deutsch)
===> Marktplatz
=====> Auktionen
=====> Suche
=====> Biete
=> Ελληνικά (Greek)
===> Αγορά
===> Mining Discussion (Ελληνικά)
===> Altcoins (Ελληνικά)
=====> Altcoin Announcements (Ελληνικά)
=====> Altcoin Mining (Ελληνικά)
=> עברית (Hebrew)
=> Français
===> Actualité et News
===> Débutants
===> Discussions générales et utilisation du Bitcoin
===> Mining et Hardware
===> Économie et spéculation
===> Place de marché
=====> Échanges
=====> Produits et services
=====> Petites annonces
===> Le Bitcoin et la loi
===> Wiki, documentation et traduction
===> Développement et technique
===> Vos sites et projets
===> Hors-sujet
===> Altcoins (Français)
=====> Annonces
=> India
===> Mining (India)
===> Marketplace (India)
===> Regional Languages (India)
===> Press & News from India
===> Alt Coins (India)
===> Buyer/ Seller Reputations (India)
===> Off-Topic (India)
=> Italiano (Italian)
===> Guide (Italiano)
===> Progetti
===> Discussioni avanzate e sviluppo
===> Trading, analisi e speculazione
===> Mercato
=====> Mercato valute
=====> Beni
=====> Servizi
=====> Esercizi commerciali
=====> Hardware/Mining (Italiano)
=====> Gambling (Italiano)
===> Accuse scam/truffe
===> Mining (Italiano)
===> Alt-Currencies (Italiano)
=====> Annunci
===> Raduni/Meeting (Italiano)
===> Crittografia e decentralizzazione
===> Off-Topic (Italiano)
=> 日本語 (Japanese)
===> アルトコイン
=> Nederlands (Dutch)
===> Markt
===> Gokken/lotterijen
===> Mining (Nederlands)
===> Beurzen
===> Alt Coins (Nederlands)
===> Off-topic (Nederlands)
===> Meetings (Nederlands)
=> Nigeria (Naija)
===> Politics and society (Naija)
===> Off-topic (Naija)
=> 한국어 (Korean)
===> 대체코인 Alt Coins (한국어)
=> Pilipinas
===> Altcoins (Pilipinas)
=====> Altcoin Announcements (Pilipinas)
===> Pamilihan
===> Others (Pilipinas)
=> Polski
===> Tablica ogłoszeń
===> Alternatywne kryptowaluty
=====> Nowe kryptowaluty i tokeny
=====> Tablica ogłoszeń (altcoiny)
=> Português (Portuguese)
===> Primeiros Passos (Iniciantes)
===> Economia & Mercado
===> Mineração em Geral
===> Desenvolvimento & Discussões Técnicas
===> Criptomoedas Alternativas
===> Brasil
===> Portugal
=> Русский (Russian)
===> Новички
===> Бизнес
=====> Барахолка
=====> Обменники
===> Идеи
===> Кодеры
===> Майнеры
===> Политика
===> Трейдеры
===> Альтернативные криптовалюты
=====> Токены
=====> Бayнти и aиpдpoпы
===> Хайпы
===> Работа
===> Разное
===> Oбcyждeниe Bitcoin
=====> Новости
=====> Юристы
=> Română (Romanian)
===> Anunturi importante
===> Offtopic
===> Market
=====> Discutii Servicii
===> Minerit
===> Tutoriale
===> Bine ai venit!
===> Presa
===> Altcoins (Monede Alternative)
=====> Anunturi Monede Alternative
=> Skandinavisk
=> Türkçe (Turkish)
===> Bitcoin Haberleri
===> Pazar Alanı
===> Madencilik
===> Ekonomi
===> Servisler
=====> Fonlar
===> Proje Geliştirme
===> Alternatif Kripto-Paralar
=====> Madencilik (Alternatif Kripto-Paralar)
=====> Duyurular (Alternatif Kripto-Paralar)
===> Konu Dışı
===> Yeni Başlayanlar & Yardım
===> Buluşmalar
=> Other languages/locations
Loading...